I am using Eclipse(Mars) with MinGW, "GNU Fortran Compiler" and "GNU Fortran Linker" to build a Windows DLL from Fortran code. This is working okay for Debug configuration, but when I switch to creating a Release build, it is producing
an EXE file rather than a DLL.
I checked the Linker settings, and -shared is specified. I compared my settings between Debug and Release, and they are the same.
Linker options:
* Debug: -L <lib file> -v -shared -Wl,--output-def=<def file>
* Release: -L <lib file> -v -shared -Wl,--output-def=<def file>
"Expert settings" (Command line pattern) are also the same ...
* Debug: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
* Release: ${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}
After the build, I looked in the Console window, and I am seeing the switch ‘-o’ ‘M92Fort.exe’. I don’t know where this is coming from, but it’s obviously the reason why the linker is producing an exe file rather than a dll.
I tried explicitly adding -o M92Fort.dll in the “Linker flags” box on the “Settings/Linker/Miscellaneous” pane, but it only appends that to the -o M92Fort.exe switch that’s already there, and still produces an exe file rather than
a dll.
What could I be doing wrong?