-
Can't link hello world.
Guys that is code copied from a book (Programming Windows 5th edition):
Code:
#include <windows.h>
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
{
MessageBox (NULL, TEXT ("Hello, Windows 98!"), TEXT ("HelloMsg"), 0) ;
return 0 ;
}
Can't link it with VS2010. What am I doing wrong?
Error 1 error LNK2001: unresolved external symbol _WinMainCRTStartup
Thanks.
-
it's probably complaining about the "Windows 98" part :)
Seriously: have you defined your project as a Win32 project, CLR project, console project?
If you choose the wrong project options VS is going to link to a different set of libraries, leading to errors like the one you're getting.