Sign in to follow this  
uktaicho

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this