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

查看:129
本文介绍了为什么MSVC 2010 32位项目链接到64位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?

推荐答案

简短回答: Dependency Walker for x86用于x86 .

长答案:最初,我在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:\ windows \ winsxs \ amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.7601.17514_none_2b24536c71ed437a \ GDIPLUS.DLL",我使用了 x86的Dependency Walker .对我来说就像魅力一样!

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

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

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