[pgf77] undefined reference to `_gfortran_*'

Hello,

I have a problem using pgf77 with a library (libsud8.a).

I do:

  pgf77 -pgf90libs OBJ_EXE/plage_cg.o -o  XXXXXX YYYYYYYY/yyyy.o ZZZZZZ/zzzzz.o -L. -fpic -lFFFFFFFFF -L/MYLIBSUD8_PATH -lsud8 -L/A_OTHER_PATH/ -lfsu

And i get the following erreur:

/MYLIBSUD8_PATH/libsud8.a(charge.o): In function `charge_':
charge.f:(.text+0xc3): undefined reference to `_gfortran_st_write'
charge.f:(.text+0xcf): undefined reference to `_gfortran_st_write_done'
charge.f:(.text+0x119): undefined reference to `_gfortran_st_write'
charge.f:(.text+0x12f): undefined reference to `_gfortran_transfer_integer'
charge.f:(.text+0x13b): undefined reference to `_gfortran_st_write_done'
charge.f:(.text+0x22d): undefined reference to `_gfortran_generate_error'
charge.f:(.text+0x259): undefined reference to `_gfortran_generate_error'
charge.f:(.text+0x271): undefined reference to `_gfortran_st_inquire'
charge.f:(.text+0x30f): undefined reference to `_gfortran_st_write'

Would you have any idea on “how” to resolve this problem ?


Thank you,

goethe.

Hi goethe,

This means that the objects in the sud8 library were compiled with gfortran. Please add the flag “-g77libs” to have the PGI compiler add the gfortran run time libraries so these symbols can resolved. Note that this assumes that you have gfortran installed on you system. Another option is to rebuild libsud8 library with the PGI compilers.

Hope this helps,
Mat