Visual C++ 可执行文件和缺少 MSVCR100d.dll [英] Visual C++ executable and missing MSVCR100d.dll

查看:21
本文介绍了Visual C++ 可执行文件和缺少 MSVCR100d.dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这已经在其他地方被问到并得到了回答,但是我在使用 MS Visual Studio 2010 时遇到了问题.我已经开发了一个 C++ 可执行文件,但是如果我在没有VC++ 运行时库(即 msvcr100d.dll),我收到程序无法启动,因为您的计算机缺少 msvcr100d.dll"错误.

I know this has been asked in other places and answered, but I'm having issues with MS Visual Studio 2010. I've developed a C++ executable but if I run the Release version on a machine that doesn't have the VC++ runtime library (ie, msvcr100d.dll), I get the "program cannot start because msvcr100d.dll is missing from your computer" error.

这很奇怪有两个原因:

  • 为什么要尝试与可再发行组件的调试版本链接?
  • 我尝试应用此修复程序,将运行时库设置设置为/MT 而不是/MD(多线程 DLL),但这只会使问题变得更糟(如果我手动复制 msvcr100d.dll,它会说找不到 msvcp110.dll).
  • Why is it trying to link with the debug version of the redistributable?
  • I tried applying this fix, setting the runtime library setting to /MT instead of /MD (multi-threaded DLL), but that only made the problem worse (if I manually copied msvcr100d.dll, it then said it couldn't find msvcp110.dll).

如何将运行时库与我的可执行文件打包在一起,以便我可以在没有安装 MS VC 2010 或可再发行组件的机器上运行它?

How can I package the runtime library with my executable so that I can run it on machines that don't have MS VC 2010 or the redistributable installed?

我知道包含 DLL 的副本被认为存在安全风险,因为它永远不会更新,但我的目标只是在短期内将此可执行文件发送给几个朋友.

I know it's considered a security risk to include a copy of the DLL since it won't ever be updated, but my goal is just to send this executable to a few friends in the short term.

推荐答案

如果您在发布"模式下编译,您绝对不需要 CRT 的调试版本.您可以判断它们是 DLL 的调试版本,因为它们以 d 结尾.

You definitely should not need the debug version of the CRT if you're compiling in "release" mode. You can tell they're the debug versions of the DLLs because they end with a d.

更重要的是,调试版本不可可重新分发,因此它不像将其与可执行文件打包"或压缩这些 DLL 一样简单.

More to the point, the debug version is not redistributable, so it's not as simple as "packaging" it with your executable, or zipping up those DLLs.

检查以确保您正在发布"模式下编译应用程序的所有组件,并且您正在链接正确版本的 CRT 和您使用的任何其他库(例如、MFC、ATL 等).

Check to be sure that you're compiling all components of your application in "release" mode, and that you're linking the correct version of the CRT and any other libraries you use (e.g., MFC, ATL, etc.).

,当然,需要 msvcr100.dll(注意没有 d 后缀)和其他一些,如果它们不是已安装.指导您的朋友下载 Visual C++ 2010 Redistributable(或 x64),或自动将其包含在您的应用程序中通过构建安装程序.

You will, of course, require msvcr100.dll (note the absence of the d suffix) and some others if they are not already installed. Direct your friends to download the Visual C++ 2010 Redistributable (or x64), or include this with your application automatically by building an installer.

这篇关于Visual C++ 可执行文件和缺少 MSVCR100d.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆