undefined references in f2c

Tobias Schlüter Tobias.Schlueter@physik.uni-muenchen.de
Fri Feb 15 14:35:00 GMT 2008


Carla Santos wrote:
>  I have to complile a mixture of code written in C++ and Fortran. That
> code was made to run in Sun OS, but I am doing the porting to Linux.
> For compiling C++ I am using g++ and for compiling fortran I am using
> f2c and gcc (4.1.1). I made a download of f2c and the libraries
> libf2c. I started to compile, but I am getting troubles in some local
> libraries of undefined references even when I use -lgfortran. I made
> some readings in the net and people talk about uncompatibilities.
> Can you help me in this issue?

It's been a long time since I used f2c but its libraries should be 
linked with -lf2c (or was it -lg2c?).  If you have gfortran installed it 
probably makes more sense to compile the Fortran code directly with 
gfortran (perhaps with the -ff2c option to prevent different calling 
conventions from getting in the way).

Cheers,
- Tobi

-- 
Tobias Schlüter
Am Coulombwall 1, Zi. 326
85748 Garching b. München
Tel.: +49/89/289-14139



More information about the Fortran mailing list