C++ 由于未找到 MSVCP100D.dll,应用程序无法启动,重新安装应用程序可能会起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4668566/
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
Application has failed to start because MSVCP100D.dll was not found, reinstalling app may work
提问by Marko29
I googled on this and realized there are probably several causes to this so I will describe my scenario.
我搜索了这个并意识到可能有几个原因,所以我将描述我的场景。
This happens when my application tries to load a .dll file built in another version of Visual Studio (2010), if I build the same project on Visual Studio 2008 the DLL file loads just fine...
当我的应用程序尝试加载在另一个版本的 Visual Studio (2010) 中构建的 .dll 文件时会发生这种情况,如果我在 Visual Studio 2008 上构建相同的项目,则 DLL 文件加载得很好......
I don't know if it matters, but Visual Studio 2010 DLL file version is built on Windows 7 x32, and Windows Vista 64-bit is on the other side with Visual Studio 2008.
我不知道这是否重要,但 Visual Studio 2010 DLL 文件版本是在 Windows 7 x32 上构建的,而 Windows Vista 64 位则是在 Visual Studio 2008 的另一侧。
采纳答案by David Heffernan
If you link dynamically to the MSVC runtime then you need to install that runtime on every machine that will run your app.
如果您动态链接到 MSVC 运行时,那么您需要在将运行您的应用程序的每台机器上安装该运行时。
Note that in this case you appear to be linking to the debug version of the runtime, it is not normal to distribute apps linked against the debug version of the runtime.
请注意,在这种情况下,您似乎链接到运行时的调试版本,分发链接到运行时调试版本的应用程序是不正常的。
回答by oob
If you do not want to distribute the runtime, then you can switch your Runtime Library options in Visual Studio (Properties -> C/C++ -> Code Generation -> Runtime Library) from /MD to /MT or from /MDd to /MTd.
如果不想分发运行时,则可以将 Visual Studio 中的运行时库选项(属性 -> C/C++ -> 代码生成 -> 运行时库)从 /MD 切换到 /MT 或从 /MDd 切换到 /MTd .
As others have said, if you are distributing this application you should be linking dynamically or statically to the Release version of the Runtime library, not the Debug version.
正如其他人所说,如果您要分发此应用程序,您应该动态或静态链接到运行时库的发布版本,而不是调试版本。
回答by user3046045
Just an small related advice: DON'T ADD any *248d.lib files while building and running in the RELEASE version.
只是一个小的相关建议:在 RELEASE 版本中构建和运行时不要添加任何 *248d.lib 文件。
I was following advice from different blogs, and I accidentally added both *248d.lib as well as the 248.lib files. Basically in Linker→ Input→ Add Dependencies, ensure that you don't have *248d.lib files in it (here 248 is version 2.4.8).
我遵循了不同博客的建议,我不小心添加了 *248d.lib 和248.lib 文件。基本上在 Linker→ Input→ Add Dependencies 中,确保您没有 *248d.lib 文件(这里 248 是版本 2.4.8)。
I spent hours wondering why things weren't working in the release mode until it struck me that there are two copies of .lib files, one *248 and other *248d. If you include any of the d files in release mode, you will get the DLL issue.
我花了几个小时想知道为什么在发布模式下一切都不起作用,直到我突然想到有两个 .lib 文件副本,一个 *248 和另一个 *248d。如果您在发布模式下包含任何 d 文件,您将遇到 DLL 问题。