C ++ / CLI缺少MSVCR90.DLL [英] C++/CLI Missing MSVCR90.DLL

查看:157
本文介绍了C ++ / CLI缺少MSVCR90.DLL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个c ++ / cli dll,我在运行时加载,在调试模式下工作得很好。如果我尝试在释放模式下加载dll,则无法加载说明缺少一个或多个依赖项。如果我运行依赖于我,我从MSVCM90.DLL中缺少MSVCR90.DLL。如果我检查dll的调试版本,它也有缺少的依赖关系,但是对于debug(D)版本。



我已经确保调试/释放嵌入了清单文件。我读了一些关于这个问题的应用程序加载dll正在构建为任何CPU和dll正在构建为x86,但我看不到如何将它们设置为x86。



我正在使用VS2010。



无论如何,我一直在搞乱一段时间,不知道有什么问题。我确定有人在那里知道发生了什么。让我知道如果我需要包含额外的信息。



alt text http://www.freeimagehosting.net/uploads/fb31c0e256.png



更新:



最终解决了我的问题: http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07794679-159b-4363-ae94-a68fe258d827

解决方案

MSVCR90是Visual Studio 2008 的运行时。如果您在开发计算机上运行应用程序,那么您应该安装调试和释放运行时(作为Visual Studio的一部分),但是安装可能会出现问题,或者VS2010实际上并不包括旧的运行时间。如果您尝试在不同的PC上运行版本,那么只需要运行安装。



无论哪种方式,您可以通过安装 Visual Studio 2008可再分发 - 但请确保您的电脑正确下载(x86或x64)。



在以前版本的VS中,您需要编译版本的运行时所以,如果VS2010遵循这个先例,你需要MSVCR100,而不是MSVCR90 - 这表明你可能没有重新编译dll与VS2010 - 这样做可能是另一种方法让它运行在你的电脑(使用redist,您的VS2010安装),但请注意,您仍然需要其他用户在其PC上安装适当的(VS2010)可重新分发。



至于任何CPU与x86 ,这只是在64位计算机上的问题。在这些系统上,64位应用程序无法动态链接到32位dll。如果您将应用程序编译为任何CPU,则将JIT编译为64位操作系统上的64位,如果尝试直接调用任何32位dll,则会崩溃。这个解决方案是构建面向x86的应用程序,因为它强制JIT编译器生成32位代码(即使在64位机器上),从而确保与您想要调用的DLL兼容。如果DLL是一个托管程序集,那么您可以在应用程序上使用任何CPU,因为它们都将以相同的格式进行JIT。


I have a c++/cli dll that I load at runtime and which works great in debug mode. If I try and load the dll in release mode it fails to load stating that one or more dependencies are missing. If I run depends against it I am missing MSVCR90.DLL from MSVCM90.DLL. If I check the debug version of the dll it also has the missing dependency, but against the debug (D) version.

I have made sure debug/release embed the manifest file. I read something about there being issues with the app loading the dll being build as Any CPU and the dll being built as x86, but I don't see how to set them both to x86.

I am using VS2010.

Anyway, I've been messing around for a while now and have no idea what is wrong. I'm sure someone out there knows what is going on. Let me know if I need to include additional info.

alt text http://www.freeimagehosting.net/uploads/fb31c0e256.png

UPDATE:

This ended up being the resolution to my problem: http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/07794679-159b-4363-ae94-a68fe258d827

解决方案

MSVCR90 is the runtime for Visual Studio 2008. If you are running your application on your development PC, then you should have the debug and release runtimes installed (as part of Visual Studio) but it is possible something has gone awry with your install, or that VS2010 doesn't actually include the older runtimes. If you're trying to run the Release on a different PC, then it just needs the runtime installed.

Either way, you may be able to fix it by installing the Visual Studio 2008 redistributable - but make sure you get the right download for your PC (x86 or x64).

In previous versions of VS, you needed the runtime for the version you were compiling with, so if VS2010 follows this precedent you'd need MSVCR100, not MSVCR90 - which suggests that you may not have recompiled the dll with VS2010 - doing so may be another approach to get it running on your PC (using the redist that is in your VS2010 install) but beware that you will still need other users to install the appropriate (VS2010) redistributable on their PC.

As for "Any CPU" versus "x86", this is a problem only on a 64-bit computer. On those systems a 64-bit application can't link dynamically to 32-bit dlls. If you compile your application as "Any CPU" it will be JIT compiled to be 64-bit on an 64-bit OS, so will crash if it tries to call any 32-bit dlls directly. THe solution is to build the application targeting "x86" as that forces the JIT compiler to generate 32-bit code (even on a 64-bit machine) and thus ensures compatibility with the dll you wish to call. If the DLL is a managed assembly, then you can use Any CPU on both the app an dll as they will both be JITted to the same format.

这篇关于C ++ / CLI缺少MSVCR90.DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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