Jump to content
  • Advertisement
Sign in to follow this  
Ahrimal

Error with WinMain

This topic is 3809 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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, ^^

Share this post


Link to post
Share on other sites
Advertisement
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Yep it comes with it, ^^

Well, now that i have a window (hoorray!!) time to see how to handle it, :D

Thx a lot again

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!