'undefined reference' - C++ calling fortran


While liking an object file from Fortran, which is abc.o (compiled using pgf90) to C++ (main.C), I keep getting the message below.

$ pgCC abc.o main.C -lpgf90 -lpgf90_rpm1 -lpgf902 -lpgf90rtl -lpgftnrtl

$ main.C: undefined reference to `abc_’

The code has been modified as in the reference manual, but I don’t know why mine does not work.


If anyone knows how to solve this problem, please reply… Thanks!!!

Hi sempre578,

Can you post your example or how you declare ‘abc’ in fortran and how it’s used in the C++ code? The example correct so I’m wondering how you have abc declared in your code.

  • Mat