Definition of _gfortran_os_error?
Alberto Luaces
aluaces@udc.es
Mon Jun 2 09:28:00 GMT 2008
Hello,
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:
$ g++ cbfg.o cbf.o -o cbf4 -lgfortran
cbf.o: In function `rellenar_array':
/home/alberto/testsFortran/c_binding3.f90:20: undefined reference to
`_gfortran_os_error'
On the other hand, if I link with gfortran and -lstdc++, it works although
objdump says that symbol is undefined:
$ gfortran cbfg.o cbf.o -o cbf4 -lstdc++
$ objdump -tT ./cbf4 | grep os_error
0000000000000000 F *UND* 000000000000002c
_gfortran_os_error@@GFORTRAN_1.0
0000000000000000 DF *UND* 000000000000002c GFORTRAN_1.0
_gfortran_os_error
I really wanted to link with g++ instead of gfortran, does anyone know which
special flag is using gfortran at linking time in order to bypass that error?
My specs:
gcc version 4.2.4 (Debian 4.2.4-1)
gcc version 4.3.1 20080523 (prerelease) (Debian 4.3.0-5)
Thank you,
Alberto
More information about the Fortran
mailing list