This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
libgfortran linking problem
- From: Tim Holme <timholme at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 25 Jun 2009 15:45:58 -0700
- Subject: libgfortran linking problem
- References: <8aeeb60906251543s2bd5b03fsb1a99c7874d2f4b6@mail.gmail.com>
when compiling a fortran program with gfortran and linking with
-lgfortran, I'm having undefined references to gfortran programs.
>gfortran -o foo?[lots of .o?files]??-L/usr/pubsw/lib/ -llapack -L/usr/pubsw/lib/ -lblas -L/usr/lib/gcc/x86_64-linux-gnu/4.3 -lgfortran -lgfortranbegin
For example, I get error messages related to:
undefined reference to `_gfortran_transfer_array'
undefined reference to `_gfortran_os_error'
both of these functions appear in the libgfortran I'm linking against:
> nm /usr/lib/gcc/x86_64-linux-gnu/4.3/libgfortran.a | grep os_error
0000000000000840 T _gfortran_os_error
0000000000000840 T _gfortrani_os_error
???????????????? U _gfortrani_os_error
???????????????? U _gfortrani_os_error
> nm /usr/lib/gcc/x86_64-linux-gnu/4.3/libgfortran.a | grep transfer_array
0000000000000670 T _gfortran_transfer_array
How can I link in libgfortran properly??Is it a versioning issue?? I
find my gfortran version :
> gfortran --version
GNU Fortran (Ubuntu 4.3.3-5ubuntu4) 4.3.3
and I link against the libgfortran in a 4.3 directory:
/usr/lib/gcc/x86_64-linux-gnu/4.3
Any ideas?? Thanks very much,
T