I have recently created an application for x64 system. The problem which is continuously occurring is that, the application works on my PC but does not works on my laptop. As soon as I try to launch the application it displays MSVCR120D.dll is missing but I have all the packages from 2010-2013 installed on my laptop. Even if I copy-paste the dll file externally it gives me an error something like 0xc000007b.
1 Answers
Your app is compiled in debug mode and also it is using the .dll CRT version (check [SO]: Errors when linking to protobuf 3 on MS Visual C (@CristiFati's answer) for more details), that's why it requires MSVCR120D.dll (notice the D as its name's last letter).
You must rebuild your app in release mode since CRT debug libraries cannot be redistributed. In that case the app will require MSVCR120.dll (no D) which is allowed to be distributed (and it could even be there installed by other app).
Don't manually copy these .dlls other machines, but use the installers: [MS]: Visual C++ Redistributable Packages for Visual Studio 2013.
I am assuming that your app doesn't have any .NET Framework dependencies.
If you want to check the dependencies of an .exe / .dll file, try Dependency Walker (or newer [GitHub]: lucasg/Dependencies).
Now, if none of the above succeeds, I am posting a workaround (gainarie) that is to be as much as possible avoided especially if your app uses .dlls created by you:
In VStudio IDE, go to your app's project options (properties) Configuration Properties -> C/C++ -> Code Generation -> Runtime Library and choose either one of the options except Multi-threaded Debug DLL (/MDd) (as that one won't work), depending on your project configuration (debug or release), and rebuild your app.
Now the app either:
Won't be needing the CRT .dll.
CRT code won't be in the .dll, but rather inserted directly in your app's .exe - as a result the new .exe will have a bigger size).
This applies to /MT, /MTdWill be needing the distributable CRT (.dll) which can be installed on Win machines.
This applies to /MD
As a general practice, when creating software supposed to run on multiple machines, build it in release mode.

- 38,250
- 9
- 50
- 87
-
Thanks for your reply, but when I compile it a blank windows pops up on my screen I don't know why.... – codectile Jul 16 '15 at 03:06
-
That's not good. Could you post Visual Studio's "Output" window's content here? – CristiFati Jul 16 '15 at 03:11
-
I can link you to the screenshot of my form though. http://i.imgur.com/yGlVxlf.png – codectile Jul 16 '15 at 05:07