使用 Visual C++ 2008 在调试模式下找不到 MSVCR90D.dll

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/218747/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 13:48:55  来源:igfitidea点击:

MSVCR90D.dll not found in debug mode with Visual C++ 2008

c++visual-studio-2008debuggingwinsxsmsvcr90d.dll

提问by

I have a problem with Visual C++ 2008. I have installed opencv and I've created a new program and I build it with no errors. However, it complains about not finding MSVCR90D.dll when debugging. In release mode there is no problem at all.

我在使用 Visual C++ 2008 时遇到了问题。我已经安装了 opencv 并创建了一个新程序,并且在构建时没有出现错误。但是,它抱怨在调试时找不到 MSVCR90D.dll。在发布模式下完全没有问题。

I do have MSVCR90D.dll in one of Winsxs folders. Does anyone know a get-around to this problem? Is this a known bug?

我在 Winsxs 文件夹之一中有 MSVCR90D.dll。有谁知道解决这个问题的方法?这是一个已知的错误?

Gerard

杰拉德

回答by Jorge Ferreira

There are several potential solutions described in this forum post. See if any of those help.

论坛帖子中描述了几种可能的解决方案。看看这些是否有帮助。

One hint from there:

来自那里的一个提示:

Go to %System Drive%\Windows\WinSxS and look for the directory x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456

If this doesn't exist, go to the VS setup and make sure you have all libraries installed under VC++.

转到 %System Drive%\Windows\WinSxS 并查找目录 x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456

如果这不存在,请转到 VS 设置并确保在 VC++ 下安装了所有库。

And another one:

还有一个:

I had the same problem, but fixed it by turning off incremental linking (Project properties... Linker... General... Enable Incremental Linking: No).

我遇到了同样的问题,但通过关闭增量链接(项目属性...链接器...常规...启用增量链接:否)来修复它。

Confirming the last one:

确认最后一个:

Projects built on a software-mounted drive complain about a missing MSVCR90D.dll. The problem goes away if you turn off incremental linking (and rebuild all, of course).

建立在软件安装驱动器上的项目抱怨缺少 MSVCR90D.dll。如果您关闭增量链接(当然并全部重建),问题就会消失。

回答by x_x

Having the same problem I found a post that lead me to the debug DLLs in the VS9.0 install. For the default install they were in: C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC90.DebugCRT.

遇到同样的问题,我找到了一篇文章,该文章将我带到了 VS9.0 安装中的调试 DLL。对于默认安装,它们位于:C:\Program Files\Microsoft Visual Studio 9.0\VC\redist\Debug_NonRedist\x86\Microsoft.VC90.DebugCRT.

There are three DLLs and a manifest file. You can add these to your System32directory, add the directory to your PATHenvironment variable or copy the files to same directory as your executable when debugging.

共有三个 DLL 和一个清单文件。您可以将这些添加到您的System32目录中,将目录添加到您的PATH环境变量或在调试时将文件复制到与您的可执行文件相同的目录中。

Incremental linking speeds up your builds (the linker only re-links libs that have changed instead of re-linking the entire project). It otherwise has no effect on the build output. For a large project I would not recommend turning off incremental linking.

增量链接可加快构建速度(链接器仅重新链接已更改的库,而不是重新链接整个项目)。否则它对构建输出没有影响。对于大型项目,我不建议关闭增量链接。

回答by Markus

Had the same problem although another VC9.0 project did well. So I compared both project settings. The crucial difference was under 'Project Properties' -> 'Configuration Properties' -> 'Manifest Tool' -> 'Input and Output' -> 'Embed Manifest'. This option must be set to YES.

尽管另一个 VC9.0 项目做得很好,但遇到了同样的问题。所以我比较了两个项目设置。关键的区别在于“项目属性”->“配置属性”->“清单工具”->“输入和输出”->“嵌入清单”。此选项必须设置为 YES。

回答by MSalters

Troublehooting DLL problems is a lot easier with Dependency Walker . It allows you to profile your application, catching both DLLs loaded at startup and DLLs loaded later. It will spit out a lot of messages related to the loading of DLLs, or the failure to load them. It also understands SxS loading of DLLs.

使用 Dependency Walker 可以更轻松地解决 DLL 问题。它允许您分析您的应用程序,捕获启动时加载的 DLL 和稍后加载的 DLL。它会吐出很多与加载 DLL 或加载失败相关的消息。它还理解 DLL 的 SxS 加载。

You can pass an EXE as a argument to Depends.EXE, and it will profile that app. This can be combined with most IDEs. For instance, in Visual Studio you can set the "Command for Debugging". By default, that's your own EXE. Change it to depends.EXE, and set the command arguments to (at least) /pb your.debug.exe.

您可以将 EXE 作为参数传递给 Depends.EXE,它会分析该应用程序。这可以与大多数 IDE 结合使用。例如,在 Visual Studio 中,您可以设置“调试命令”。默认情况下,这是您自己的 EXE。将其更改为depends.EXE,并将命令参数设置为(至少)/pb your.debug.exe

回答by user388764

Recompile your project in VC++ 2008 using function File->New->Project From Existing Code. It helped myself, probably it will help you. Regards.

使用函数 File->New->Project From Existing Code 在 VC++ 2008 中重新编译您的项目。它帮助了我自己,可能它会帮助你。问候。

回答by Mustafa Kemal

I have solved same problem like below:

我已经解决了如下相同的问题:

  1. Select project, right click and open property page.
  2. Select Configuration Properties.
  3. Select C/C++ from tree list.
  4. Select Code Generation.
  5. Look at the property list at left side and see the Runtime Libraryproperty.
  6. Select Multi-threaded Debuginstead off Multi-threaded DLL.
  1. 选择项目,右键单击并打开属性页。
  2. 选择配置属性。
  3. 从树列表中选择 C/C++。
  4. 选择代码生成。
  5. 查看左侧的属性列表并查看Runtime Library属性。
  6. 选择多线程调试而不是关闭多线程 DLL。

When you do that, your project embeds depended dlls and so it escaped dependency problems.

当你这样做时,你的项目嵌入了依赖的 dll,因此它避免了依赖问题。

Note: I worked on a dll project and had that problem. After doing above steps it worked for my situation.

注意:我在一个 dll 项目上工作并遇到了这个问题。完成上述步骤后,它适用于我的情况。

回答by opie

I tried all the suggested solutions without any luck. I finally found that the manifest was missing from the "C:\WINDOWS\WinSxS\Manifests"folder.

我尝试了所有建议的解决方案,但没有任何运气。我终于发现"C:\WINDOWS\WinSxS\Manifests"文件夹中缺少清单。

Find the folder in C:\WINDOWS\WinSxSwhere your dll is located. Check to see if there is a manifest in C:\WINDOWS\WinSxS\Manifeststhat matches the folder name of your dll. If the manifest is missing, copy the correct manifest from another machine and paste it into the manifest folder. The manifest file names are:

找到C:\WINDOWS\WinSxS您的 dll 所在的文件夹。检查是否有C:\WINDOWS\WinSxS\Manifests与您的 dll 的文件夹名称匹配的清单。如果清单丢失,请从另一台计算机复制正确的清单并将其粘贴到清单文件夹中。清单文件名是:

"x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456.cat"

"x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456.manifest"

“x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456.cat”

“x86_Microsoft.VC90.DebugCRT_1fc8b3b9a1e18e3b_9.0.21022.8_x-ww_597c3456.manifest”

回答by Adam Rosenfield

I can't give a definitive solution, but here are some helpful links:

我无法给出明确的解决方案,但这里有一些有用的链接:

And of course, there's a lot more on MSDN if you follow the links.

当然,如果您点击链接,MSDN 上还有更多内容。

回答by Adam Rosenfield

I had the problem:

我遇到了问题:

Could not load file or assembly 'AudioInterface, Version=1.0.3548.29920, Culture=neutral, PublicKeyToken=null' or one of its dependencies. This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)

无法加载文件或程序集“AudioInterface,Version=1.0.3548.29920,Culture=neutral,PublicKeyToken=null”或其依赖项之一。此应用程序无法启动,因为应用程序配置不正确。重新安装应用程序可能会解决此问题。(来自 HRESULT 的异常:0x800736B1)

AudioInterface was the name of my C++ project.

AudioInterface 是我的 C++ 项目的名称。

Switching to "Release" config, everything worked.

切换到“发布”配置,一切正常。

I tracked it to lack of the manifest file alongside my DLL, which I further tracked to having an Assembly Identity set. (Properties > Manifest Tool > General > Assembly Identity)

我追踪到它缺少我的 DLL 旁边的清单文件,我进一步追踪到它设置了程序集标识。(属性 > 清单工具 > 常规 > 装配标识)

I removed this setting, and the manifest dropped in the right place, and everything worked.

我删除了这个设置,清单放在正确的位置,一切正常。

回答by Rob

This is one of the reasons that I statically link; bigger EXEs but I have never had a dependency issue like this before. Probably worth a question in itself though...

这是我静态链接的原因之一;更大的 EXE,但我以前从未遇到过这样的依赖问题。虽然可能本身就值得一个问题......