C++ MSVCP140.dll 丢失
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32998902/
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
MSVCP140.dll missing
提问by Deepster12
I just developed my first program in C++ and I wanted to show it with one of my friends. Sadly, when he tries to open the exe it gets an error which says "MSVCP140.dll is missing". Why is this issue happening and how can he/I fix it?
我刚刚用 C++ 开发了我的第一个程序,我想和我的一个朋友一起展示它。可悲的是,当他尝试打开 exe 时,它收到一条错误消息,指出“MSVCP140.dll 丢失”。为什么会发生这个问题,他/我该如何解决?
回答by David Haim
Either make your friends download the runtime DLL (@Kay's answer), or compile the app with static linking.
要么让您的朋友下载运行时 DLL(@Kay 的回答),要么使用静态链接编译应用程序。
In visual studio, go to Project tab -> properties - > configuration properties -> C/C++ -> Code Generation
on runtime library choose /MTd
for debug mode and /MT
for release mode.
在 Visual Studio 中,转到Project tab -> properties - > configuration properties -> C/C++ -> Code Generation
运行时库选择/MTd
调试模式和/MT
发布模式。
This will cause the compiler to embed the runtime into the app. The executable will be significantly bigger, but it will run without any need of runtime dlls.
这将导致编译器将运行时嵌入到应用程序中。可执行文件会大得多,但它无需任何运行时 dll 即可运行。
回答by kay - SE is evil
Your friend's PC is missing the runtime support DLLs for your program:
您朋友的 PC 缺少您程序的运行时支持 DLL:
回答by BlindGarret
That usually means that your friend does not have the Microsoft redistributable for Visual C++. I am of course assuming you are using VC++ and not MingW or another compiler. Since your friend does not have VS installed as well there is no guarantee he has the redist installed.
这通常意味着您的朋友没有适用于 Visual C++ 的 Microsoft 可再发行组件。我当然假设您使用的是 VC++ 而不是 MingW 或其他编译器。由于您的朋友也没有安装 VS,因此无法保证他安装了 redist。
回答by Anon Mail
That's probably the C++ runtime library. Since it's a DLL it is not included in your program executable. Your friend can download those libraries from Microsoft.
这可能是 C++ 运行时库。由于它是一个 DLL,因此它不包含在您的程序可执行文件中。您的朋友可以从 Microsoft 下载这些库。