I want to call a C++ function from a F77 main program. I have defined in the main program:
DOUBLE PRECISION FC34F, bf_Fc34F
and do a call like
FC34F = bf_Fc34F( temp )
The function bf_Fc34F is the C function in a *.C file and is defined as
double bf_Fc34F_( double T ){
T="some_mathematical_expression";
return T;
}
I am using g++/gfortran and when compiling the *.C file (g++ -c *.C) the *.o file has a trailing "_d" (for "double" I think) attached to it, which the main program does not have, and thus I am getting an "undefined reference" error.
Does anyone know how to overcome this issue?