Author Topic: Fortran ==> undefined reference to `WinMain'  (Read 7486 times)

Offline RIH3306

  • Single posting newcomer
  • *
  • Posts: 2
Fortran ==> undefined reference to `WinMain'
« 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?

 

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Fortran ==> undefined reference to `WinMain'
« Reply #1 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/
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline RIH3306

  • Single posting newcomer
  • *
  • Posts: 2
Re: Fortran ==> undefined reference to `WinMain'
« Reply #2 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.