How to solve issues related to missing runtime libs on different development machines?
I have been working on a game in C++ for over a year now. Recently I had to change the development machine. As soon as I run the game I get the following error message:
The application was unable to start correctly (0xc000007b). Click OK to close the application.
I have been trying to solve this issue for over a week, many articles on the net state that c runtime libs are missing, other state that there are issues with display drivers, etc. I tried reinstalling the drivers, reinstalling direct x, reinstalling the C runtime, and I could never run/debug the game with visual studio. Does anyone have any idea what should I check?
Is this your game built from source, or just binary you got from somewhere?
If it is your game, then run it under debugger, or attach when it crashes - then examine in what place it crashed.
If it is just binary you got, then it could be runtime/dll issue. And if you cannot attach to it with Visual Studio then it's very likely this is missing/wrong dll problem - you cannot debug process that doesn't start. So download DependencyWalker (or different tool, I use hiew32, but that is commercial tool) that will allow you to examine on which dll files your exe depends and look what's missing. Often this happens because exe is built with debug C/C++ dll runtime, but that is not redistributable and exact same version of Visual Studio must be installed to have same debug dll files. Check if exe depends on msvcr1x0d.dll file. "d" suffix in name is from "debug", "x" can be different digit depending on VS version.
Another option is that your OS is 32-bit, but you are starting 64-bit exe.
Or you have 32 or 64-bit OS, but exe is 32-bit, but it tries to load 64-bit dll file (from same folder, or in PATH).
Obviously this won't work.
After running dependency walker, I found that there is one 64 bit dll: MSVCP120D.DLL, and underneath it is the same one but 32 bit. Not sure how that happened, but at least I know the reason for the issue now.
I will have to see how to remove that reference in order to solve the issue.
Thanks again and have a wonderful day.
Edit: I placed a 32 bit copy of the dll in the directory and the game worked. So I assume that the default library being used is 64 bit, i must force visual studio to use the 32 bit some how, that seems to be the actual reason for the issue.