error LNK2019 and fatal error LNK1120

T

Tim

I am just creating a hellow world program and it gave me
these errors. can you help me out how to resolve this?

Thanks,
Tim

#include <iostream>

using namespace std;

int main()
{
cout << "hello World" << endl;
return 0;
}


Linking...
LIBCD.lib(wincrt0.obj) : error LNK2019: unresolved
external symbol _WinMain@16 referenced in function
_WinMainCRTStartup
Debug/HelloWorld.exe : fatal error LNK1120: 1 unresolved
externals

Build log was saved at "file://c:\Documents and
Settings\tng\My Documents\Visual Studio
Projects\HelloWorld\Debug\BuildLog.htm"
HelloWorld - 2 error(s), 0 warning(s)


---------------------- Done ----------------------

Build: 0 succeeded, 1 failed, 0 skipped
 
C

Catweasel

Did you manage to resolve this problem?

I am getting the same error when trying to link a library file:

Linking...
libcmt.lib(wincrt0.obj) : error LNK2019: unresolved external symbol
_WinMain@16 referenced in function _WinMainCRTStartup
Debug/HelloWorld.exe : fatal error LNK1120: 1 unresolved externals

Cheers

<EDIT>
I eventually found that I was following some guidlines too closely.
They were creating a Window Application. My code was for a console
application and therefore uses main()
</EDIT>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top