NO

Author Topic: POLINK error  (Read 2623 times)

Al

  • Guest
POLINK error
« on: July 26, 2015, 03:20:05 AM »
I'm new to C and just downloaded Pelles C for Windows.  My C Programming book gives the source code for displaying "Hello, World"  on the screen as a first exercise.  Entered source code and compiled OK.  Tried to run the .exe file and got POLINK: error Unresolved external symbol "WinMain".  I'm running an HP Pavillion Laptop with 64-bit Windows 7.  Is this an incompatibility with Windows 7?  How do I fix the error?
Al

MichaelW

  • Guest
Re: POLINK error
« Reply #1 on: July 26, 2015, 08:30:04 AM »
If you try to build a console app, for which the entry-point function is normally named "main", as a windows app, where the subsystem type on the Linker tab in the project options dialog is set to "Windows", and for which the entry-point function is normally named "WinMain", the linker will return an Unresolved external symbol 'WinMain' error.

The fix is to ensure that the subsystem type matches the entry-point function.
« Last Edit: July 26, 2015, 08:37:00 AM by MichaelW »

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2096
Re: POLINK error
« Reply #2 on: July 26, 2015, 11:33:16 AM »
To change subsystem go to menu: project=>options. Open linker tab and you will see the subsystem section. Under type change it to console.
It is better to be hated for what you are than to be loved for what you are not. - Andre Gide

Al

  • Guest
Re: POLINK error
« Reply #3 on: July 26, 2015, 05:40:11 PM »
My sincere thanks to both MichaelW and frankie for responding with the fix I needed.  I changed the subsystem to console and everything worked perfectly.  It was particuarly helpful that frankie gave step-by-step instructions on how to effect the change.  I would not have known where to go to find all of that without it.
Al