• Advertisement
Sign in to follow this  

Problem trying to make a window using in C++, using VS2008

This topic is 2970 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, i'm just another beginner trying to learn some things on game development, and i have the following problem In Visual Studio 2008 i write #include <windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { MessageBox(NULL, L"Hello World", L"Hello World Window", MB_ICONEXCLAMATION | MB_OK); return 0; } ...in order to create a window with an OK button. And when trying to run it i get ================================================================================ ------ Build started: Project: test, Configuration: Debug Win32 ------ Compiling... test.cpp Linking... MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup C:\myprojects\test\Debug\test.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\myprojects\test\Debug\BuildLog.htm" test - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== ================================================================================ This is probably an already answered noob question but i'd appreciate any kind of help since i didn't find any solution that would work for me in relevant topics. Thanx

Share this post


Link to post
Share on other sites
Advertisement
You created a console application instead of a Win32 application when you created the project, so the compiler is looking for main() rather than WinMain() as the entry point.

Your best bet is to re-create the project as a Win32 application.

Share this post


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

  • Advertisement