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
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.
To change subsystem go to menu: project=>options. Open linker tab and you will see the subsystem section. Under type change it to console.
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