Code::Blocks Forums

User forums => General (but related to Code::Blocks) => Topic started by: RIH3306 on April 04, 2015, 12:13:45 am

Title: Fortran ==> undefined reference to `WinMain'
Post by: RIH3306 on April 04, 2015, 12:13:45 am
I'm stuck getting gfortran to work with codeblocks.

I followed the fortran setup  <http://wiki.codeblocks.org/index.php?title=Installing_Fortran_Compiler>

The project compiles the fortran files just fine, but linking fails with  undefined reference to `WinMain'

When I make a new project, and select console application, I see c and c++ as options, but should I see fortran?

When I create the project, a main.c is automatically added to the project, WHY?

It looks like my console application is expecting a c project, not a fortran.

What am I missing?

 
Title: Re: Fortran ==> undefined reference to `WinMain'
Post by: oBFusCATed on April 04, 2015, 01:46:34 am
The console project template is c/c++ only.
I don't know if there is an empty project template for fortran.
Probably you can get better support for fortran related questions here: http://darmar.vgtu.lt/
Title: Re: Fortran ==> undefined reference to `WinMain'
Post by: RIH3306 on April 06, 2015, 08:42:59 pm
My bad.

When making a new project, select the Fortran specific console application, not the C/C++ console application.

Thank you.