Why does MSVC 2010 32bit project link to 64bit kernel32.dll?

前端 未结 3 783
慢半拍i
慢半拍i 2021-01-17 17:57

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

3条回答
  •  囚心锁ツ
    2021-01-17 18:15

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

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

    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!

提交回复
热议问题