This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Definition of _gfortran_os_error?
- From: Alberto Luaces <aluaces at udc dot es>
- To: fortran at gcc dot gnu dot org
- Date: Mon, 2 Jun 2008 11:28:44 +0200
- Subject: Definition of _gfortran_os_error?
- Organization: UDC
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