I have a simple Windows program that I got from a tutorial. It's a basic message box. However, when I try to compile it, I get error LNK2019. I must be missing an include file, or a library file, or a variable definition. I wanted to post this in the Windows Programming section. But, for some reason, it won't go through. Here is the code in its entirety:
1 2 3 4 5 6 7 8 9
// Message Box Test Program
#include <windows.h>
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
MessageBoxA(0,"Message here","Title Bar",0);
return 0;
}
Compiler error messages typically contain specific information relevant to the problem. Always post the entire error message, verbatim, when asking for help. Never post only the error number - many posters won't recognize the issue by number and will not bother to look it up.
Thanks. That fixed the problem. Took a bit of looking though. In my compiler, it was under the "Debug" menu. I don't know why it would have tagged this as a console app. I clearly selected the "Windows Win32 App" template.
My antivirus wasn't liking the .exe at first. But, it adjusted. That possibility was never mentioned in any of the tutorials.