Visual Studio missing msvcr120d.dll and msvcp120d.dll error - c++

I am using Visual Studio 2013 I cant run my exe on another computers because of missing missing msvcr120d.dll and msvcp120d.dll.
I already downloaded vcredist from:
http://www.microsoft.com/en-us/download/details.aspx?id=40784
I tried MT (Multi-threaded) but same error. :(
Please help I tried everything.

You are linking against the Debug CRT library (indicated by the trailing d). Those aren't redistributable, and are only available on systems, where Visual Studio is installed.
The solution is to compile a release configuration. A release configuration links against the Release CRT library, that is part of the Visual C++ Redistributable Packages for Visual Studio 2013, and can be deployed alongside your application.
A release configuration can be built by selecting Release from the configuration dropdown list:

Related

Missing DLL in Release but not in Debug

I am porting an old MFC application from Visual Studio 2008 to Visual Studio 2019.
In the process, an old DLL library has been incorporated into the source code to remove the library building step in development.
Now, this program runs and functions perfectly when debugging in the default Debug configuration; however, in the Release configuration I get:
The code execution cannot proceed because MSVCR90.dll was not found
I imagine this means that MSVCR90d.dll is successfully found in Debug mode, but cannot find the release version of the DLL for some reason.
I've tried all the general steps of downloading Visual C++ Runtime redistributables, changing to statically linked runtime libraries, and most other things found in the first results on Google.
All intermediate versions of Visual Studio are installed locally on the development machine (2008, 2010, 2015, 2017, and 2019).
Is there anything else I could try?
All the speculation can be avoided, if you install Dependency Walker https://dependencywalker.com and see exactly what is missing where and what the differences of the release and the debug builds are.

Link to a specific .dll file in Visual Studio?

I have written a C++ program using OpenGl in Visual Studio 2015 for Windows 7. I compiled my code using "release" instead of "debug". The program works fine on my computer, but when I move to another computer the program fails. I get the error message:
The program can't start because MSVCP140D.dll is missing from your computer. Try reinstalling the program to fix this problem.
I would like for my program to work on other computers so that I don't have to install the newest drivers or libraries in order for it to work. I have MSVCP140D.dll on my first computer, but I only have MSVCP120.dll on my other computer. How do I compile my code so that it does not require MSVCP140D.dll, but instead works with MSVCP120.dll?
First make sure your build settings are correct for release build : MSVCP140D.dll is the debug DLL of the Visual Studio 2015 runtime; the release version of this libray is MSVCP140.dll.
When you've fixed this, then you can install the Visual C++ Redistributable for Visual Studio 2015 on the target computer where you want to run your program : this will install the missing library. Notice that the VC++ redistributable does not install the debug libraries (MSVCP140D.dll) but the release ones (MSVCP140.dll).
Another option is to rebuild your program with static linking to the Visual C++ runtime. Open the Project Properties dialog and, in "Configuration Properties -> C/C++ -> Code Generation", field "Runtime Library", choose "Multi-threaded (/MT)". This way, there is no need to install the VC++ redistributable on the target computer.
You need to install Visual Studio 2013 in order to be able to link with MSVCP120.dll (you can continue using MSVC 2015, but select 2013 as the toolchain). Once MSVC 2013 is installed, you will be able to select it in project settings -> Platform Toolset.
Or link your application statically (change /MD to /MT in Code Generation settings). Then your app won't need any MSVC DLL to run (but it will become bigger).
Or install the VC 2015 Redistributable package on your other computer.

How to fix error MSVCP120D.dll in Visual Studio 2015?

Hello I have downloaded and unzipped OpenCV-2.4.10.exe on my PC. Then created a new Win32 Console application project in VS 2015, set all the Paths in Project properties, set the environmental variables in Win8.1. When I'm trying to start the program in debugging mode I get the "The program can't start because MSVCP120D.dll is missing from your computer. Try reinstalling the program to fix this problem".
Then, I downloaded the Visual C++ redistributable for Visual Studio 2015 But the problem still remains. What should I do to use OpenCV in VS 2015?
OpenCV-2.4.10.exe comes with runtime binary dlls built to work with runtimes from vc10 (vs2010), vc11 (vs2012) and vc12 (vs2013).
These DLL files use MSVCP100.dll, MSVCP110.dll and MSVCP120.dll respectively, and if you have installed Visual Studio 2015 you should find them in your System32 (or SysWOW64) directory.
The MSVCP120D.dll error appears when your application tries to load the DEBUG version of the DLL binaries. You do not have MSVCP120D.dll unless you have Visual Studio 2013 installed on your system. To solve this problem, use the Release runtime instead of the Debug runtime.
All you need to do is exclude the DEBUG lib files from your project. This means including only the lib files without the suffix 'd'. (ie. include opencv_core2410.lib instead of opencv_core2410d.lib)
HTH
Extras:
You don't really need to load the Debug binaries, unless you need to debug openCV's source code. If you do, there's still a way. Download the openCV source code, use CMake to create a VS2015 project. You can then build your own dll binaries using the latest runtime from VS2015.
VS2015 uses vc14 while OpenCV2.4.10 doesn't come with pre-built binaries associated with vc14. This answer should help you to understand. Accordingly you should choose the right folder (vc14) for Linker>General>Additional Library Directories in project properties.
You can use cmake to build binaries using VS2015 or you can download a later version of OpenCV which has prebuilt binaries for vc14.

MSVCP120d.dll missing

Every time I want to compile my Visual Studio project I get the message that MSVCP120d.dll is missing. Google can't help me. I already installed some redistributables but they didn't help. I also found this:
Msvcp120d.dll Debug version of C++ runtime. No redistribution
allowed.
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx
From the comments, the problem was caused by using dlls that were built with Visual Studio 2013 in a project compiled with Visual Studio 2012. The reason for this was a third party library named the folders containing the dlls vc11, vc12. One has to be careful with any system that uses the compiler version (less than 4 digits) since this does not match the version of Visual Studio (except for Visual Studio 2010).
vc8 = Visual Studio 2005
vc9 = Visual Studio 2008
vc10 = Visual Studio 2010
vc11 = Visual Studio 2012
vc12 = Visual Studio 2013
vc14 = Visual Studio 2015
vc15 = Visual Studio 2017
vc16 = Visual Studio 2019
The Microsoft C++ runtime dlls use a 2 or 3 digit code also based on the compiler version not the version of Visual Studio.
MSVCP80.DLL is from Visual Studio 2005
MSVCP90.DLL is from Visual Studio 2008
MSVCP100.DLL is from Visual Studio 2010
MSVCP110.DLL is from Visual Studio 2012
MSVCP120.DLL is from Visual Studio 2013
MSVCP140.DLL is from Visual Studio 2015, 2017 and 2019
There is binary compatibility between Visual Studio 2015, 2017 and 2019.
I have found myself wasting time searching for a solution on this, and i suspect doing it again in future. So here's a note to myself and others who might find this useful.
If MSVCP120.DLL is missing, that means you have not installed Visual C++ Redistributable Packages for Visual Studio 2013 (x86 and x64). Install that, restart and you should find this file in c:\Windows\System32 .
Now if MSVCP120D.DLL is missing, this means that the application you are trying to run is built in Debug mode. As OP has mentioned, the debug version of the runtime is NOT distributable.
So what do we do?
Well, there is one option that I know of: Go to your Project's Debug configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd). This will statically link MSVCP120D.dll into your executable.
There is also a quick-fix if you just want to get something up quickly: Copy the MSVCP120D.DLL from sys32 (mine is C:\Windows\System32) folder. You may also need MSVCR120D.DLL.
Addendum to the quick fix: To reduce guesswork, you can use dependency walker. Open your application with dependency walker, and you'll see what dll files are needed.
For example, my recent application was built in Visual Studio 2015 (Windows 10 64-bit machine) and I am targeting it to a 32-bit Windows XP machine. Using dependency walker, my application (see screenshot) needs the following files:
opencv_*.dll <-- my own dll files (might also have dependency)
msvcp140d.dll <-- SysWOW64\msvcp140d.dll
kernel32.dll <-- SysWOW64\kernel32.dll
vcruntime140d.dll <-- SysWOW64\vcruntime140d.dll
ucrtbased.dll <-- SysWOW64\ucrtbased.dll
Aside from the opencv* files that I have built, I would also need to copy the system files from C:\Windows\SysWow64 (System32 for 32-bit).
You're welcome. :-)
I have the same problem with you when I implement OpenCV 2.4.11 on VS 2015.
I tried to solve this problem by three methods one by one but they didn't work:
download MSVCP120.DLL online and add it to windows path and OpenCV bin file path
install Visual C++ Redistributable Packages for Visual Studio 2013 both x86 and x86
adjust Debug mode. Go to configuration > C/C++ > Code Generation > Runtime Library and select Multi-threaded Debug (/MTd)
Finally I solved this problem by reinstalling VS2015 with selecting all the options that can be installed, it takes a lot space but it really works.
I downloaded msvcr120d.dll and msvcp120d.dll for 32-bit version and then, I put them into Debug folder of my project. It worked well. (My computer is 64-bit version)
My problem was with x64 compilations deployed to a remote testing machine. I found the x64 versions of msvp120d.dll and msvcr120d.dll in
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT
I had the same problem in Visual Studio Pro 2017: missing MSVCP120.dll file in Release mode and missing MSVCP120d.dll file in Debug mode.
I installed Visual C++ Redistributable Packages for Visual Studio 2013 and Update for Visual C++ 2013 and Visual C++ Redistributable Package as suggested here Microsoft answer this fixed the release mode.
For the debug mode what eventually worked was to copy msvcp120d.dll and msvcr120d.dll from a different computer (with Visual studio 2013) into C:\Windows\System32
Alternate approach : without installation of Redistributable package.
Check out in some github for the relevant dll, some people upload the reference dll for their application dependency.
you can download and use them in your project , I have used and run them successfully.
example : https://github.com/Emotiv/community-sdk/find/master
I was building my application on VS 2019 when this issue came up. You can copy these DLLs from this location into debug directory of your application to get going.

SQLAPI++ in VS 2012

I am trying to use SQLapi library from inside Visual Studio 2012 x64 but SQLapi does not have lib & dll.
Of Visual Studio 2012 so I used older version from Visual Studio 2010 dll and lib.
First I got an error msvcr100d.dll not found (I think it is for Visual Studio 2010) even for Visual Studio 2010 x64.
Redistributal is installed, and I added to debug a folder manually, then I ran the program, I got another error.
The application was unable to start correctly (0xc000007b). Click OK to close the application.
This may have been due to debug mode so I changed it to release mode but I got 22 linker errors what is wrong? I am not getting the exact problem.
Thanks in advance.
This problem is solved by SQLAPI team in newer version.