为什么 MSVC 2010 32bit 项目链接到 64bit kernel32.dll? [英] Why does MSVC 2010 32bit project link to 64bit kernel32.dll?

查看:29
本文介绍了为什么 MSVC 2010 32bit 项目链接到 64bit kernel32.dll?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Win32(32 位)DLL 项目,它可以无错误地构建和链接.DLL 无法加载到 32 位进程中.使用 DependencyWalker,我看到 DLL 是 32 位的,但已与 kernel32、msvcr100d、ws2_32 和 msvcr100 的 64 位库链接.

I have a Win32 (32bit) DLL project which builds and links without error. The DLL fails to load into a 32bit process. Using DependencyWalker, I see that the DLL is 32bit but has been linked with 64bit libraries for kernel32, msvcr100d, ws2_32 and msvcr100.

DependencyWalker 也显示错误

DependencyWalker also shows an error

Error: Modules with different CPU types were found.

我已经对这个问题困惑了几个小时,只是无法理解 - 有没有其他人遇到过这种情况,并找到了解决方案?

I've puzzled over this problems for a couple of hours now, and just can't fathom it - has anyone else experienced this, and found a solution?

推荐答案

简短回答:对于 x86 的东西,使用 Dependency Walker for x86.

Short Answer: Use Dependency Walker for x86 for x86 stuff.

长答案:最初我在 MS Windows 7 操作系统上使用 Dependency Walker for x64 并遇到了您所做的障碍.然后我遵循了 MerickOWA 关于更改搜索路径的建议(感谢 MerickOWA).虽然我仍然有一些依赖项导致错误:发现具有不同 CPU 类型的模块".

Long Answer: Initially I used Dependency Walker for x64 on the MS Windows 7 OS and ran into the hurdles you did. I then followed MerickOWA's advice about changing the search paths (thanks MerickOWA). Though I still had a handful of dependencies causing "Error: Modules with different CPU types were found".

而不是弄清楚如何配置 Dependency Walker 以在奇怪的路径中搜索 x86 DLL,例如c:windowswinsxsamd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_27a14_none_17514_none_27a2gdl"x86 的依赖 Walker.对我来说就像一个魅力!

Instead of figuring out how to configure Dependency Walker to search for the x86 DLLs in bizarre looking paths like "c:windowswinsxsamd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_2b24536c71ed437aGDIPLUS.DLL" correctly, I used the Dependency Walker for x86. Worked like a charm for me!

这篇关于为什么 MSVC 2010 32bit 项目链接到 64bit kernel32.dll?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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