# \[pgf77\] undefined reference to \`\_gfortran\_\*'

**URL:** <https://forums.developer.nvidia.com/t/pgf77-undefined-reference-to-gfortran/133208>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [September 11, 2012, 9:07am UTC](https://forums.developer.nvidia.com/t/pgf77-undefined-reference-to-gfortran/133208 "2012-09-11T09:07:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![goethe1](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@goethe1](https://forums.developer.nvidia.com/u/goethe1)\
**Post date:** [September 11, 2012, 9:07am UTC](https://forums.developer.nvidia.com/t/pgf77-undefined-reference-to-gfortran/133208/1 "2012-09-11T09:07:06Z")

</div>

Hello,

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

I do:

```nohighlight
  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:

```nohighlight
/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.

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [September 11, 2012, 5:41pm UTC](https://forums.developer.nvidia.com/t/pgf77-undefined-reference-to-gfortran/133208/2 "2012-09-11T17:41:10Z")

</div>

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
