0

How can I link object files produced with MinGW64 fortran (gfortran) compiler (.o) to MSVC 2010?

I just want to use 64 bit arpack library with 64 bit MSVC solution, but all other ways to do it were unsuccessful. MSVC finds arpack functions with 32 bit solution's configuration but starts application with a runtime error and can't find arpack function with 64 bit solution's configuration at all.

Dmitry K.
  • 313
  • 3
  • 17
  • I doubt that that's even possible as the obj-file format of GCC is not compatible with the one from CL... – MFH Dec 06 '12 at 10:32

1 Answers1

0

Short answer: you can't. Those compilers use different ABI's meaning their object file format is different and incompatible.

What might be possible is to let create MinGW a DLL out of the Fortran code. Import that into your C++ Program, but beware of name mangling: The Symbols exported by the DLL must not be mangled (I am not sure if there is name mangling in Fortran at all). In your C++ code the functions imported from the DLL have to be declared "extern C" to prevent name mangling on the C++ side.

Arne Mertz
  • 24,171
  • 3
  • 51
  • 90