Okay, so I'm trying to teach myself C++, and I'm copying some code from the book. It's the "Hello World" thing.... it's my first time actually typing in code. I'm using Visual Studio 2010 Express edition, and here's my code:
//1.1-Hello World-Mark Lee
#include <iostream>
int main( void )
{
using std::cout;
cout<<"Hello World!\n";
return 0;
}
When I try to run it (CTRL + F5), a message pops up saying my project is out of date. On the same window it asks me if I want to build it. I say yes.
Then a new window pops up saying "There were build errors. Would you like to continue and run the last successful build?" If I press yes, it pops up saying its unable to start the program because the system is unable to find the program specified.
As I was copying this from the book, like it said, and I haven't actually learned anything yet, I don't know what to look for error-wise. Thanks for any help
Question
Guest
Okay, so I'm trying to teach myself C++, and I'm copying some code from the book. It's the "Hello World" thing.... it's my first time actually typing in code. I'm using Visual Studio 2010 Express edition, and here's my code:
//1.1-Hello World-Mark Lee
#include <iostream>
int main( void )
{
using std::cout;
cout<<"Hello World!\n";
return 0;
}
When I try to run it (CTRL + F5), a message pops up saying my project is out of date. On the same window it asks me if I want to build it. I say yes.
Then a new window pops up saying "There were build errors. Would you like to continue and run the last successful build?" If I press yes, it pops up saying its unable to start the program because the system is unable to find the program specified.
My output looks like this:
1>------ Build started: Project: Hello World, Configuration: Debug Win32 ------
1> HelloWorld.cpp
1>MSVCRTD.lib(crtexew.obj) : error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup
1>C:\Users\*******\documents\visual studio 2010\Projects\Hello World\Debug\Hello World.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
As I was copying this from the book, like it said, and I haven't actually learned anything yet, I don't know what to look for error-wise. Thanks for any help
Edited by NickFlemingLink to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.