Error 0xc00007b
basically means "invalid image format" which usually happens when mixing 64-bit and 32-bit DLLs. What is happening, is that you have a 64-bit application, looking for a particular DLL, which is in the global path, but the one in the path is 32-bit. Therefore, the problem is: it does not complain about the missing DLL, it just tries to load it. Since it is a 32-bit application, and your application is a 64-bit application, you get error 0xc00007b
.
The solution is to copy all the dependent DLLs over to the application path.
The next problem is you don't know which ones.
What you can do with msys2 shell is: go to the directory and run the command:
ldd application.exe
This will give you a list of DLLs the application depends on. Copy the msys2/mingw-w64 related DLLs to the directory. This will allow the application to find them before looking in the PATH and finding the 32-bit DLLs.
ldd
it will not account for dependencies that are linked using runtime dynamic linking (Dependency Walker allows you to profile your application, so you might catch some of them this way). – Kamala