Recommended way of calling C functions from gfortran

Paul Stodghill stodghil@cs.cornell.edu
Tue Jul 12 18:50:00 GMT 2005


I am used to mixing C and Fortran code using gcc and g77. In this case, 
I pick up the Fortran types in C by including g2c.h and use "integer", 
"doublereal", etc. in my C code.

Is there an analogous method for gfortran? In the source code, I see the 
file libgfortran.h, which contains definitions for GFC_INTEGER_4, etc., 
but this file is not installed along with the gfortran binaries and 
libraries.

I can imagine some hackish ways of deriving the right definitions of the 
Fortran types, but I would prefer to use an officially supported method 
for interfacing gcc and gfortran codes.

Thank you.



More information about the Fortran mailing list