MSVCP100D.dll is missing (OpenCV) Visual Studio 2013 - c++

So, in Visual Studio 2013 I created a program in which I use OpenCV.
But when I want to compile the program, there is an error that the MSVCP100D.dll is missing. I compile it in Debug version and I don't want to compile the program in Release version, so I need this file.
I tried to install the Microsoft Visual C++ 2010 Redistributable Package, but it is already on my computer.
Should I download the single file (MSVCP100D.dll) and paste it in C:\windows\system32\? Because there I can find the MSVCP100.dll file, but not the MSVCP100D.dll file.
I also read related questions about this problem, but it didn't help.
Edit: And now the MSVCP110D.dll is missing too. Same error, but now the MSVCP110D.dll file.

You have some code compiled in Visual Studio 2010. Recompile the code in Visual Studio 2013 to get rid of the MSVCP100D.dll dependency (replace it with MSVCP120D.dll that is).

Solution (Worked for me): In your Visual Studio project properties, under Linker>General>Additional Library Directories, use $(OPENCV_DIR)\x64\vc12\lib (For your system this may change depending on whether you use x86 or x64 version). Then your program should run. At least it worked for me :)
Explanation: I had the same problem with same version of OpenCV and VS. After a lot of research I found out that the problem might be incompatibility of OpenCV's pre-built binaries with Visual Studio 2013.
#Sheng Jiang's answer helped me. I used dependency walker and found that opencv_core2410d.dll depended on MSVCP100D.dll because opencv libraries that I was using were complied using Visual Studio 2010 (placed in vc10 folder) and MSVCP100D.dll is associated with Visual Studio 2010.
One option was to recompile the OpenCV code with Visual Studio 2013 (as suggested by Sheng Jiang's answer above). But this was unnecessary since OpenCV 2.4.10 already provides pre-built libraries built using Visual Studio 2013. These pre-built libraries are in the C:\opencv\build\x64\vc12 folder (exact path might differ for your machine).
Here comes the importance of vc10, vc11 and vc12 libraries. You choose the folder corresponding to the version of Visual Studio you are using. My mistake was to choose vc10 instead of vc12.

Related

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.

How to correctly install platform toolsets

I know there are tons of other threads about it, but I couldn't find any which could help me.
So I've got VS2013 Ultimate installed. I've got an old project which works with only VS2008SP1. On other compilers it has compatibility issues which I don't want to bother with. So I would like to try to compile it from 2013 with 2008 tools, so I hope I can compile it without uninstalling my current VS2013.
So, if I install VS2008, will this overwrite my current 2013 or just getting added as a toolset?
If I use 2008 toolset, will this work the same way as I had a VS2008?
Do I have to do something else to make it work?
And just a secondary question which is not related to may current question at all:
If I compile a lib with VS2013, can I use this lib in my VS2008 Project, or do I have to compile the lib with VS2008 too?
Thank you for your answers!
Microsoft doesn't recommend installing VS 2008 if you already have VS 2013 installed. In general they say:
We recommend that you install Visual Studio versions in the order in
which they were released. For example, install Visual Studio 2012
before you install Visual Studio 2013.
http://msdn.microsoft.com/en-us/library/ms246609.aspx
So, to answer your question: you probably should uninstall VS 2013, but you can install it again after installing VS 2008. Before doing that though it might be a good idea to clean the register as well as file leftovers from VS 2013 to avoid compatibility problems.
And yes, you can use 2008 compiler in 2013 version. There are a plenty of SO thread about it, e.g. :
Use Visual Studio 2012 and compile with older platform toolset?
How can I use Visual Studio 2010 with the Visual C++ 2008 compiler?
If I compile a lib with VS2013, can I use this lib in my VS2008
Project, or do I have to compile the lib with VS2008 too?
You have to compile this lib in VS 2008, if you want to use it with VS 2008.

Compile in Visual Studio 2013 for Visual Studio 2010 Redistributables

I have installed MS VS Express 2013 on my office computer, and compiled a DLL with it. Now when my colleague is trying to use it, she gets an error about a missing MSVCR120.DLL. We have found MSVCR100.DLL on her PC. I know that we can get MSVCR120.DLL from Microsoft. However
it will probably require admin rights, and only I have them in our team. I wonder if I can ask VS 2013 to compile the DLL so that it uses older version of redistributables? Or is installing the previous version of VS the only solution?
I found the solution — here: https://stackoverflow.com/a/1073772/674976. The distributable DLL can be statically linked to my DLL, thus removing the dependence. This is done in VS 2013 in Project Properties (Alt + F7) > Configuration Properties > C/C++ > Code Generation > Runtime Library, which should be set to Multi-threaded (/MT) from the default Multi-threaded DLL (/MD).
However, I wonder if by doing so I am actually still using redistributable DLLs of two versions and thus risk mixing the heaps and potentially causing memory allocation problems.
If someone suggests a better solution or a clear explanation why I should simply use Visual Studio 2010, I'll be happy to accept it is an answer.
Visual Studio 2013 can build Visual Studio 2010 C++ projects. To do this, you need to also have Visual Studio 2010 installed, because VS2013 will actually call the VS2010 C++ compiler.
What I have done to accomplish this is to create the solution and all the projects in Visual Studio 2010 and make sure that they build and run correctly. Then open them in Visual Studio 2013 and make sure to NOT upgrade the projects to VS2013.
Now you can use the latest tool and still build the VS2010 dlls that you need.

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.

Visual Studio 2012

I am Having some issues with Visual Studio 2012, When build my solution and run the debug it says MSVCP100D.dll is missing
Screen dump:
When i try to run my program using Release it compiles fine and runs but then it randomly runs into run time error:
it then will not build any more underlining these CV_8U & CV_8UC3
I am using OpenCV library, also my code worked perfectly fine on Visual Studio 2010; but i decided to upgrade to 2012.
I would ideally Build my solution using DEBUG..........
Any solutions or suggestions...?
Regards
It looks like you are linking against the opencv libs for Visual Studio 2010. You will have to compile the opencv library for Visual Studio 2012 yourself as the pre-built ones are for Visual Studio 2010.
The information on how to do that can be found under Installation by Making Your Own Libraries from the Source Files.