NO

Author Topic: POLINK error  (Read 3616 times)

leo

  • Guest
POLINK error
« on: April 13, 2005, 08:14:01 PM »
What causes "POLINK: error: Unresolved external symbol '_WinMain'."?

Anonymous

  • Guest
Re: POLINK error
« Reply #1 on: April 13, 2005, 09:17:08 PM »
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...
Code: [Select]

#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...  :)

project_00

  • Guest
POLINK error
« Reply #2 on: May 05, 2005, 02:57:54 PM »
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
Code: [Select]

#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;
}

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
POLINK error
« Reply #3 on: May 05, 2005, 03:55:01 PM »
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
/Pelle

Anonymous

  • Guest
POLINK error
« Reply #4 on: May 05, 2005, 06:08:50 PM »
OK thanks  :P