I am using codeblocks and I just started to try Windows programming, and everytime I try to build it, I get the debugger message: undefined reference to WinMain@16. What am I doing wrong? This is what I have so far:
#include <windows.h>
INT WINAPI wWinMain(HINSTANCE hInst,
HINSTANCE hPrevInst,
LPWSTR lpCmdLine,
INT nShowCmd)
{
int nResult=MessageBox(NULL,
"An example of Cancel,Retry,Continue",
"Hello Message Box!",
MB_ICONERROR|MB_ABORTRETRYIGNORE);
switch(nResult)
{
case IDABORT:
// 'Abort' was pressed
break;
case IDRETRY:
// 'Retry' was pressed
break;
case IDIGNORE:
// 'Ignore' was pressed
break;
}
return 0;
}
So is there anything wrong? Or is just the compiler? I am kinda new to programming (2-3 months), so I assume I did something wrong. If it IS the compiler, than is there a different, free IDE or compiler I can use? Or how to fix it at least? Oh yeah and I entered win32 project for project type.