-
Help with win32 app
i am having a problem linking this code can anyone tell me what is wrong
----begin file
Code:
#include<windows.h>
INT WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd){
MessageBox(NULL,"Welcome to my first Win32 App!!!",
"Hello",MB_OK);
return 0;
}
-----end file
the error output is
---begin
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/hello.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
----end
please help
-
You're compiling as a console program, not a Windows application.
-
You have created a windows console project and the compiler expects the entry point to be main, not WinMain.
Try setting up a Win32 project not a console project.
Edit: Damn she's quick!
-
>>unresolved external symbol _main
You're compiling it as a console app, change your compiler options to make a Windows app instead.
[edit]dammit!