If you are a Visual Studio user and a C++ programmer then you must have come across MSVCR120.dll missing (or MSVCR120d.dll or MSVCR110.dll or MSVCR100d.dll etc. missing) problem with Win32 and CLR programs created using Visual Studio.
This article is basically meant for programmers. If you’re not a programmer, and you just want to download MSVCR120.dll, you can download it here.
How to fix the MSVCR120.dll missing error
These problems occur when you try to execute Visual C++ programs created in any version of Visual Studio (i.e. 2008, 2010, 2012, 2013 etc.) on another computer which does not have the appropriate version of Visual Studio or Microsoft Visual C++ Redistributable installed.
For example, I created a Win32 application using Visual Studio 2013 and tried to execute it on another computer (which does not have Visual Studio or Visual C++ Redistributable 2012 installed). I got the following error message :
Analysis of the Problem
Here, the name MSVCR120D tells the following information about the DLL :
MS – Microsoft
V - Visual
C - C++
R - Redistributable
D - Debug
120 – Version 2012 (Visual Studio 2013 uses MS VC++ Redistributable 2012)
Similarly, the Visual C++ programs created in Release Mode (based on Microsoft Visual C++ Redistributable 2012) will require MSVCR120.dll.
Again, if I try to run the same application created using Visual Studio 2010, I get the error saying “MSVCR100D.dll” was missing.
There are the three ways to solve this problem :
a) Include the DLL in the same directory as the EXE :
The first method to solve this problem is to include the DLL in the same directory as the EXE. It is quite simple to perform this because all you have to do is to include the required DLL with every program that needs it. However, it is quite problematic in the long run.
b) Force every user of the program to install the appropriate version of Microsoft Visual C++ Redistributable :
This method eliminates the requirement of the DLL i.e. you don’t have to provide the DLL with every program that needs it. However, it is very impractical. You can’t expect everyone (i.e. including non-programmers) to install multiple versions of MSVC++ Redistributable.
c) Statically link the DLLs into your program :
The following steps are involved in this method :
1. Open your project in Visual Studio.
2. Right-click on the project name in Solution Explorer and Click Properties. The Property Pages window of your project will appear.
3. Click on Configuration Properties → C/C++ → Code Generation.
Note :- The size of the executable in this case will be much larger than the executables which require DLLs, because in this case, the code contained inside the DLL is added to the executable and it works like a static library.
The following video describes how to perform the steps mentioned above :