Problem linking objects generated from c++ and c/fortran files

Alexander Maltsev
Sun Sep 26 18:10:00 GMT 2004

Hi all,

I have a compatibility problem. If I generate object files from c++ source 
code ( with gcc, they are incompatilbe with object files generated 
 from c or fortran sources (file.c or file.f) with g77/gcc. While linking I 
always get error: reference not found. I looked into those object files 
using emacs. The function interfaces look indeed different. E.g. the 
function called interface which has two arguments:

double interface(int arg1, double* arg2)

looks like @interface@ in file.o obtained from file.c but somehow 
different like @Z9interfaceiDR@ in file.o obtained from Is it 
possible to overcome this problem?
I would expect at least C and C++ compiler to generate compatible object 
files. But it seems to be not the case.

Best regards / Freundliche GrÌße

Alexander Maltsev

More information about the Gcc-help mailing list