C++ 64 位 Win 上缺少 dll
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7568697/
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
Missing dlls on 64 bit Win
提问by Tom
I have a .net application that uses some vc++ compiled Win32 dlls. It works great on a 32 bit Win, but on 64 bit there is a problem: "Unable to load DLL 'xyz': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
我有一个 .net 应用程序,它使用一些 vc++ 编译的 Win32 dll。它在 32 位 Win 上运行良好,但在 64 位上存在问题:“无法加载 DLL 'xyz':找不到指定的模块。(来自 HRESULT 的异常:0x8007007E)”
Using dependency walker I found it misses the following dlls: MSVCP100.DLL, MSVCR100.DLL, GDIPLUS.DLL, GPSVC.DLL, IESHIMS.DLL
使用依赖walker我发现它错过了以下dll:MSVCP100.DLL、MSVCR100.DLL、GDIPLUS.DLL、GPSVC.DLL、IESHIMS.DLL
How can I install them to my 64 bit Win? Where should I put them? Should I register them? Or...?
如何将它们安装到我的 64 位 Win?我应该把它们放在哪里?我应该注册它们吗?或者...?
Note, my project is compiled for x86 platform and it is ran from Program Files (x86) folder as a 32 bit app. My dlls are comiled as Win32 via Visual C++ in Visual Studio 2010.
请注意,我的项目是为 x86 平台编译的,它是从 Program Files (x86) 文件夹作为 32 位应用程序运行的。我的 dll 在 Visual Studio 2010 中通过 Visual C++ 编译为 Win32。
Note, that it is mission impossible to get 64 version of my dlls because of some other reasons, so it would not be a solution.
请注意,由于其他一些原因,不可能获得 64 位版本的 dll,因此这不是解决方案。
Thanks!
谢谢!
回答by Alex F
The whole process should be 32 or 64 bit. If you cannot compile all dependency libraries in 64 bit, you need to run .NET project in 32 bit. To do this, create x86 configuration (default is Any CPU) and build .NET project in this configuration.
整个过程应该是32位或64位。如果无法在 64 位编译所有依赖库,则需要在 32 位运行 .NET 项目。为此,请创建 x86 配置(默认为 Any CPU)并在此配置中构建 .NET 项目。
You also need to install VC++ 2010 redistributable package on destination computer, with correct bitness, in your case - x86. This package can be downloaded from Microsoft WEB site.
您还需要在目标计算机上安装 VC++ 2010 可再发行软件包,在您的情况下具有正确的位数 - x86。该软件包可以从 Microsoft WEB 站点下载。
If your program has installation package, VC++ redistributable should be added to it as single file or as merge modules.
如果您的程序有安装包,则应将 VC++ Redistributable 作为单个文件或合并模块添加到其中。
回答by Gabriel
As ALex Farber noted, you have to install some runtime dlls on the target machine:
正如 ALex Farber 所指出的,您必须在目标机器上安装一些运行时 dll:
- The .NET runtimewith the right version, here the 4.0,
- Visual Studio redistributable package(I'm not sure of this one, it should be for C++ applications only but may be worth a try if .NET is not enough)
- 具有正确版本的 .NET 运行时,这里是 4.0,
- Visual Studio 可再发行包(我不确定这个包,它应该只用于 C++ 应用程序,但如果 .NET 不够用,可能值得一试)