Definition of _gfortran_os_error?
Alberto Luaces
aluaces@udc.es
Mon Jun 2 10:34:00 GMT 2008
FX, Tobias
thank you both. As you said, the problem came from the g++ version, since if I
do
$ g++-4.3 -lgfortran cbf.o cbfg.o -o cbf4
(that is, explicitly linking g++ 4.3 and gfortran 4.3 instead of g++ 4.2
against gfortran 4.3) it works.
As Debian default g++ is 4.2 and gfortran is 4.3, I thought that they could
safely work with each other object files. Now I see that this is not always
the case and will match both compiler versions in the future.
Regards,
Alberto
El Lunes 02 Junio 2008ES 11:38:17 Tobias Burnus escribió:
> Hello Alberto,
>
> Alberto Luaces wrote:
> > I'm writing a mixed C++/Fortran program and recently I came into a linker
> > error about _gfortran_os_error, when linking with g++ and -lgfortran
>
> Are you by chance mixing different gfortran versions? For instance g++
> and one gfortran under /usr/bin and a newer gfortran under
> "/home/alberto/gfortran" (or wherever)?
>
> That could explain the problems. Then g++ picks up
> /usr/lib/libgfortran.so* and gfortran picks up another libgfortran.
>
> If that is the case, try -L <path to gfortran lib> -lgfortran.
>
> Tobias
More information about the Fortran
mailing list