I used MinGW and the GNU Fortran compiler for a while to compile Fortran programs on Windows, which has always been a successful method. However, in the last 4 days I get the following error:
The application was unable to start correctly (0xc000007b). Click OK to close the application.
The error only occurs when starting applications that I wrote myself, and that I compiled using the MinGW / gfortran command. When compiling using Visual Studio and iFort, I have no problem running applications. The error seems retroactive: applications that were compiled using gfortran a long time ago and worked fine so far also break, although I did not recompile them. This makes me think that this is a dynamic library problem. Online queries show that this is probably a compatibility issue between a 64-bit dll and a 32-bit application
I am using Windows 7. One of the last things that I remember, before starting this problem, was trying to update MinGW; I used the mingw-get update and mingw-get update commands.
After browsing the Internet, I tried the following fixes:
- reinstall Visual C ++ runtime
- reinstall the .NET platform
- downloaded and replaced a bunch of DLL files such as mscvr100.dll, mscvr100d.dll, etc.
- uninstalled and reinstalled MinGW to make sure I have the latest version of gcc
- Launch Dependency Walker in a simple application (program like "Hello World!")
Dependency Walker tells me that it is not possible to find multiple DLL files (full list: API-MS-WIN-APPMODEL-RUNTIME-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-ERROR-L1-1- 0.DLL, API-MS-WIN-CORE-WINRT-L1-1-0.DLL, API-MS-WIN-CORE-WINRT-ROBUFFER-L1-1-0.DLL, API-MS-WIN-CORE- WINRT-STRING-L1-1-0.DLL, API-MS-WIN-SHCORE-SCALING-L1-1-1.DLL, DCOMP.DLL, GPSVC.DLL, IESHIMS.DLL).
It also highlights libquadmath-0.dll in red (which libgfortran-3.dll seems to depend on). Indeed, it seems that libquadmath-0.dll is a 64-bit DLL in the middle of a 32-bit program. When I open a DLL with Dependency Walker, I see that all the modules in this library are x86, except for the library itself, which is x64 (CPU DW column). I'm not quite sure how this is possible / how to fix it. The library is in the Python / Anaconda folder (I installed Python and Anaconda a few weeks ago, while the problem did not appear).
If anyone has an idea how to get my environment working again without reinstalling Windows, I would really appreciate it! Thanks!!