I can' find my errors in basic C++

I have programed before but it's been over 2 years so I tried thing I could remember but nothing is working for me. I started over with hello world but again it won't work. here's my code

#include <iostream>

using namespace std;

int main()
{
cout << "Hello World!!" << endl;
system("PAUSE");

return 0;
}


and here are the errors


Error 1 error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup MSVCRTD.lib this one


Error 2 fatal error LNK1120: 1 unresolved externals u:\Visual Studio 2008\Projects\this one\Debug\this one.exe 1 this one


what do I do please help.
closed account (S6k9GNh0)
1. Don't use system(). I'll eat your liver if you do.
2. Right click your project. Go to Properties -> Linker -> System -> SubSystem -> Console (/SUBSYSTEM:CONSOLE)
You started with the wrong project template, you have to choose Empty Project
Coputerquip
system() worked fine for me

Bazzy
your awesome I opened a new project and just copy/paused and it worked. Thanks so much, maybe that was the problem the whole time.
fire child,
Some People Dont like system(), and they have Great reasons too, which you will learn
in the future, but for now you will be fine. And if you dont want to use system() anymore,
try using getch();

take a look at this, which will back up what computer equip is saying:
http://cplusplus.com/forum/articles/11153/
system() worked fine for me

That's not the point. If you are interested in learning how to program you must learn about portability. Executing OS commands using system() is completely non-portable (e.g., your use of system will not work on unix). It's also inefficient since it starts another process to run the command. You should replace it with cin.get();, which will work fine as long as you haven't left any newlines in the input (and cin is in a good state).
Last edited on
So to save headaches in the future don't use system(). Noted, thanks
try using getch();
That is bad too...
try using cin.get() lol
Last edited on
Topic archived. No new replies allowed.