Calling MinGW/CygWin gnu toolchain objects from MSVC
From Admin-SIG
I have seen a lot of documentation about how to generate DLLs using CygWin or MinGW tools, and calling them from commercial Windows tools like MSVC or Borland. This is fine for larget projects, but another common problem is simply supporting legacy FORTRAN or Pascal code in a Windows development environment. It may not be necessary, or cost effective, to putchase full suites of FORTRAN or Pascal compilers just to be able to re-use some snippet of legacy code. The headaches of maintaining DLL's and generating .LIBs for each tool are really not worth it just to get that matrix inverter written in FORTRAN.
This has not been fully tested yet, but it appears that the reason for the deafening quiet about generating .LIB files with gnu which are callable from MSVC is that it could be trivally easy. MSVC seems to have been able link to a library created with commands like:
ar ruvl test.lib *.o
ranlib test.lib
Name manglings do seem to be a little different for these GNU tools than some of the commercial FORTRAN tools. It appears that a FORTRAN SUBROUTINE called MYSUB (built by g77) could be called as the function mysub_ from MSVC.

