I am trying to link on Windows a Fortran code with C++. The Fortran code is compiled with gfortran from MinGW, and the other C++ parts are being compiled with MSVC.
The problem is that the linker generates the following error message:
libgfortran.a(read.o) : error LNK2016: Absolute symbol '_strtoflt128' used as target of REL32 relocation
With the Intel fortran compiler it works.
Tools:
GNU Fortran 6.3.0
MSVC 2013
I used the CMake generated Visual Studio project, which automatically invokes the Microsoft linker. The linker arguments(cleaned):
/MANIFEST /NXCOMPAT /DYNAMICBASE "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "comdlg32.lib" "advapi32.lib" "libgfortran.a" "libmingwex.a" "libmingw32.a" "libquadmath.a" "libgcc_s.a" "libgcc.a" "libgcc_eh.a" /MACHINE:X86 /SAFESEH:NO /INCREMENTAL:NO /SUBSYSTEM:CONSOLE /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /ERRORREPORT:PROMPT /NOLOGO /TLBID:1 /machine:X86 /NODEFAULTLIB:"libcpmt.lib"
I tested also on 64 bit and it generates the same error.