All my fortran sources are compiled with
gfortran -g -c fortran_source.f
and archived in one library called "mylibrary.a" There exists an interest function called "myfunction"
In my C ++ file, I have:
extern "C" void myfunction_();
int main(){
cerr << "Mark 1" << endl;
myfunction_();
cerr << "Mark 2" << endl;
}
I am compiling my C ++ executable by linking the library to
g++ mainfile.cpp -L./ -lmylibrary -lgfortran
No errors or warnings ...
However, when I run my program, it freezes at the first point where myfunction is called (prints "Mark1" but not "Mark 2") ...
Note that this program builds and works correctly on a Linux machine with ifort (linking -lifcore).
Many thanks!
source
share