# Solved: C 'Linker Error: Undefined symbol _main in module WINMAIN



## racock (May 23, 2007)

Hello,

Haven't done any C programming in a year, but I've got to update my scripting app for changing the format of a bulk load of files, so I'm back at it.

I'm using Borland Turbo C++ 3.1 (wince for abuse ), which I've used ever since I left Uni far too many years ago. All of my apps which used to work are coming up with the error 'Linker Error: Undefined symbol _main in module WINMAIN' when I attempt to build them. I know they used to work, because I have the executables to prove it!

Most searches have revealed that 'you need a "main()" process' which I know isn't the case when you're using WinMain(), but I've obviously got some environment / configuration setting wrong. 

I'm using a project '4matter2.prj' which includes a resource file '4matter2.rc', two headers '4matter2.dlg' and '4matdlgr.h' in addition to the main '4matter.c' code.

I've tried two fresh installs of Borland Turbo C++ 3.1 on different laptops (one of which was the one I used to write the apps some time in April last year), both generate the same error for all of my project based apps.

I can compile and make the executable if I only use the .c, but obviously, I lose my icon and menus which are stored in the resource file.

Any help much appreciated.

Rich.


----------



## racock (May 23, 2007)

It's ok, for some reason, my projects had different files included in them. No idea how it'd worked before (unless I'd broken them all afterwards). in the project file you need the .def file that tells Turbo C what exports to make, also include the .c, but not the headers (since there part of the include statements in the .c.

Sorry to waste anyone's time, but thanks for looking.

Rich.


----------

