C++ MSVCP120d.dll 丢失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21707992/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MSVCP120d.dll missing
提问by MazzMan
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:
每次我想编译我的 Visual Studio 项目时,我都会收到缺少 MSVCP120d.dll 的消息。谷歌帮不了我。我已经安装了一些可再发行组件,但它们没有帮助。我也发现了这个:
Msvcp120d.dll Debug version of C++ runtime. No redistribution allowed.
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx
Msvcp120d.dll C++ 运行时的调试版本。不允许重新分配。
http://msdn.microsoft.com/en-us/library/windows/hardware/dn448963(v=vs.85).aspx
回答by drescherjm
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).
从评论来看,问题是由于在使用 Visual Studio 2012 编译的项目中使用了使用 Visual Studio 2013 构建的 dll 引起的。造成这种情况的原因是第三方库,名为包含 dll vc11、vc12 的文件夹。必须小心使用编译器版本(少于 4 位)的任何系统,因为这与 Visual Studio 的版本不匹配(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
- 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.
Microsoft C++ 运行时 dll 使用 2 或 3 位代码也基于编译器版本而不是 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
- MSVCP80.DLL 来自 Visual Studio 2005
- MSVCP90.DLL 来自 Visual Studio 2008
- MSVCP100.DLL 来自 Visual Studio 2010
- MSVCP110.DLL 来自 Visual Studio 2012
- MSVCP120.DLL 来自 Visual Studio 2013
- MSVCP140.DLL 来自 Visual Studio 2015、2017 和 2019
There is binary compatibility between Visual Studio 2015, 2017 and 2019.
Visual Studio 2015、2017 和 2019 之间存在二进制兼容性。
回答by bot3663369
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 .
如果缺少 MSVCP120.DLL,则意味着您尚未安装 Visual Studio 2013(x86 和 x64)的 Visual C++ Redistributable Packages。安装它,重新启动,你应该在 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.
现在,如果缺少 MSVCP120D.DLL,这意味着您尝试运行的应用程序是在调试模式下构建的。正如 OP 所提到的,运行时的调试版本不可分发。
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.
好吧,我知道有一个选项:转到项目的调试配置 > C/C++ > 代码生成 > 运行时库,然后选择多线程调试 (/MTd)。这会将 MSVCP120D.dll 静态链接到您的可执行文件中。
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.
如果您只想快速解决问题,还有一个快速修复方法:从 sys32(我的是 C:\Windows\System32)文件夹中复制 MSVCP120D.DLL。您可能还需要 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.
快速修复的附录:为了减少猜测,您可以使用Dependency walker。用dependency walker 打开你的应用,你会看到需要哪些dll文件。
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:
例如,我最近的应用程序是在 Visual Studio 2015(Windows 10 64 位机器)中构建的,我将它定位到 32 位 Windows XP 机器。使用依赖walker,我的应用程序(见截图)需要以下文件:
- 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
- opencv_*.dll <-- 我自己的 dll 文件(也可能有依赖性)
- 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).
除了我构建的 opencv* 文件之外,我还需要从 C:\Windows\SysWow64(System32 for 32-bit)复制系统文件。
You're welcome. :-)
别客气。:-)
回答by rookiechen
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:
我在 VS 2015 上实现 OpenCV 2.4.11 时也遇到了同样的问题。我尝试通过三种方法一一解决这个问题,但没有奏效:
- 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)
- 在线下载MSVCP120.DLL并添加到windows路径和OpenCV bin文件路径
- 为 x86 和 x86 的 Visual Studio 2013 安装 Visual C++ Redistributable Packages
- 调整调试模式。转到配置 > C/C++ > 代码生成 > 运行时库并选择多线程调试 (/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.
最后我通过选择所有可以安装的选项重新安装 VS2015解决了这个问题,它需要很多空间,但它确实有效。
回答by Anandi
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)
我下载 msvcr120d.dll
和msvcp120d.dll
32位版本,然后,我把它们放进Debug
我的项目的文件夹中。它运作良好。(我的电脑是64位版本)
回答by Kevin Johnsrude
My problem was with x64 compilations deployed to a remote testing machine. I found the x64 versions of msvp120d.dll and msvcr120d.dll in
我的问题是部署到远程测试机器的 x64 编译。我在 msvp120d.dll 和 msvcr120d.dll 中找到 x64 版本
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\redist\Debug_NonRedist\x64\Microsoft.VC120.DebugCRT
回答by lahmania
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 2013and Update for Visual C++ 2013 and Visual C++ Redistributable Packageas suggested here Microsoft answerthis 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
我在 Visual Studio Pro 2017 中遇到了同样的问题:在发布模式下缺少 MSVCP120.dll 文件,在调试模式下缺少 MSVCP120d.dll 文件。我按照此处的建议安装了 Visual Studio 2013 的 Visual C++ Redistributable Packages和Visual C++ 2013 的更新和 Visual C++ Redistributable Package,Microsoft answerthis fix the release mode。对于调试模式,最终起作用的是将 msvcp120d.dll 和 msvcr120d.dll 从另一台计算机(使用 Visual Studio 2013)复制到 C:\Windows\System32
回答by mail2subhajit
Alternate approach : without installation of Redistributable package.
替代方法:不安装 Redistributable 包。
Check out in some github for the relevant dll, some people upload the reference dll for their application dependency.
在一些 github 中查看相关的 dll,有些人上传了他们应用程序依赖项的参考 dll。
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