Error with WinMain
Hi there, im just starting using some examples on the net, and well, first try i make, first errors i get, xD
I use this simple code:
//hellow world in a window
#define WIN32_LEAN_AND_MEAN //trim down the libraries used
#include <windows.h>
#include <tchar.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR IpCmdLine, int nShowCmd){
MessageBox(NULL,_T("Hello!\n"),_T("Helo Window"),MB_OK);
return 0;
}
And i get this error:
error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
As it says, is an linking error but... well im kind of lost... cause don't know what link error can i have. :S
If some1 could help me i would be very grateful, ^^
It looks like your code is trying to find a main() function, but you've supplied a WinMain. You need to make sure your project settings are for a windows application and not a console app. What compiler/IDE are you using?
What type of project did you create? You have to select a Win32 App to make sure it loads the right dependencies. Also, I know the express version of MSVC++ 2005 did not ship with the windows platform SDK. This is an extra download needed to do windows development. I'm not sure if 2008 comes with it or not.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement