What causes "POLINK: error: Unresolved external symbol '_WinMain'."?
Quote from: "leo"What causes "POLINK: error: Unresolved external symbol '_WinMain'."?
A missing
#include <windows.h> in your code will cause that.
Another cause would be that your don't have kernel32.lib in your project's link list... check the project/options/linker tab.
The best solution is to add...
#define WIN32_DEFAULT_LIBS
#include <windows.h>
// other windows headers go here
Either at the top of each .c file or in a global header used by all .c files in your project. The #define was added in ver 3.00 to let the ide automatically create a list of libraries whenever a windows header is included. Works pretty good too... :)
Hi, I'm having this problem too
Here's my project's link list
kernel32.lib user32.lib gdi32.lib comctl32.lib comdlg32.lib advapi32.lib delayimp.lib
And here's the code
#define WIN32_DEFAULT_LIBS
#include <windows.h>
#include <stdio.h>
int main()
{
int i;
for (i=0; i<10; i++)
printf("%d\n", i);
return 0;
}
In this case you should use a Win32 Console program project, not a Win32 program project. The latter is for programs with a graphical user interface, that starts in WinMain() - not main() as you seem to want.
Pelle
OK thanks :P