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

末鹿安然 提交于 2019-11-30 05:57:16

问题


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.

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

Gerard


回答1:


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++.

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).




回答2:


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.

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

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.




回答3:


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.




回答4:


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.

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.




回答5:


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




回答6:


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 Library property.
  6. Select Multi-threaded Debug instead off Multi-threaded DLL.

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

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




回答7:


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...




回答8:


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

  • David Lenihan's blog on WinSxS
  • Side-by-side assemblies
  • Troubleshooting C/C++ Isolated Applications and Side-by-side Assemblies
  • Assembly Searching Sequence

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




回答9:


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 was the name of my C++ project.

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)

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




回答10:


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

Find the folder in C:\WINDOWS\WinSxS where your dll is located. Check to see if there is a manifest in C:\WINDOWS\WinSxS\Manifests that 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:

"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"



来源:https://stackoverflow.com/questions/218747/msvcr90d-dll-not-found-in-debug-mode-with-visual-c-2008

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!