使用 VS 2010 C++ 构建 exe 后缺少 MSVCP100.dll [英] After building exe using VS 2010 C++ missing MSVCP100.dll
问题描述
我设计了一个无需安装且可由非管理员使用的应用程序.我宁愿不丢失此功能,但是当我在其他计算机上使用 .exe 而不是在我对其进行编程的计算机上时,我收到错误消息,指出缺少 MSVCP100.dll 阻止文件执行.
I have designed an application that requires no install and can be used by non-administrators. I would rather not lose this functionality but when I use the .exe on other computers than the one I programmed it on I get an error that a missing MSVCP100.dll is preventing the file from executing.
我在这里做错了什么?如何将文件包含在我的发布版本中?
What am I doing wrong here? How do I include the file in my release build?
谢谢!
推荐答案
将项目配置为静态链接到 C/C++ 运行时,而不是链接到运行时 DLL:
Configure your project to statically link to the C/C++ runtime instead of linking to the runtime DLL:
- 配置属性 |C/C++ |代码生成 |运行时库
为您的调试版本选择多线程 (/MT)(或多线程调试 (/MTd)).
Select Multi-threaded (/MT) (or Multi-threaded Debug (/MTd) for your debug build).
作为替代方案,您应该能够使用 http://msdn.microsoft.com/en-us/library/ms235291.aspx 在将 Visual C++ 库 DLL 部署为私有程序集"标题下.我还没有尝试过这种技术,因为如果您需要本地 C++ 程序的 xcopy 安装,那么静态链接通常更简单.
As an alternative, you should be able to get xcopy deployment of the C/C++ runtime DLL using the technique documented on http://msdn.microsoft.com/en-us/library/ms235291.aspx under the heading "Deploying Visual C++ library DLLs as private assemblies". I haven't tried that technique, as it's generally simpler to just statically link if you need xcopy installation of a native C++ program.
这篇关于使用 VS 2010 C++ 构建 exe 后缺少 MSVCP100.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!