Eclipse and Fortran: "undefined reference to _WinMain@16"


I was configuring Fortran to use the lauded Eclipse IDE environment, v 3.7.0. It's huge, eh? Anyway, this single problem pestered me: undefined reference to _WinMain@16. The EXE built OK which was surprising. The web offered several solutions but none applied to me. Maybe this one will work for you.

Open the group "C/C++ Build" then subgroup "Settings". You get a whole world of further settings. Find "GNU Fortran Linker" subgroup "Libraries". See if you have an entry in the libraries called "gfortran", and remove it. Rebuild and you should be good to go.

I don't know what to recommend if you actually need this library, which sounds quite a reasonable requirement. FYI I get by with nothing in the libraries box, but in my Library search path I have the full path to CYGWIN 4.3.4.

Top of page