NO

Author Topic: POLINK error  (Read 1732 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: 1758
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.

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