运行时错误(加载DLL)与x64系统上的Win32应用程序,而编译0K应用程序、加载、错误、系统

2023-09-07 23:59:41 作者:你太耀眼我怕闪瞎狗眼i

我最初设计上的win7 32位Win32应用程序,与VC9.0。 我最近升级到WIN7 64位,并试图打造+执行previous应用程序。

I originally designed a win32 application on win7 32bits, with VC9.0. I recently upgraded to win7 64 bits, and tried to build+execute the previous application.

建筑物运行正常(Win32应用程序),但在运行时出现错误[...]已退出与code -1073741701(0xc000007b)。

Building runs fine (win32 application), but on runtime I get the error "[...] has exited with code -1073741701 (0xc000007b)."

我猜的[意] 32位DLL的64位版本,加载这个结果。

I guess this results of the loading of a 64bits version of an [intended] 32bits dll.

具体依赖于这个项目有:   SDL.lib   SDLmain.lib   SDL_ttf.lib   opengl32.lib   glu32.lib   wininet.lib

Specific dependencies for this project are: SDL.lib SDLmain.lib SDL_ttf.lib opengl32.lib glu32.lib wininet.lib

SDL和SDL_ttf仅在32位版本。 我认为Visual Studio是足够聪明,因为我要求的Win32应用程序,以获取在\ SysWOW64中的OpenGL和谷氨酸LIB文件。

SDL and SDL_ttf are only in 32bits version. I assume that Visual Studio is clever enough to fetch the opengl and glu lib files in \syswow64 as I request a win32 application.

这可能是因为WININET的?还是我犯了一个错误?

Could it be because of wininet? Or did I make a mistake?

谢谢

推荐答案

看来你加载一个64位的DLL到32位进程,反之亦然。以下是我会去追查有问题的DLL。

It appears you are loading a 64-bit DLL into a 32-bit process or vice versa. Here's how I would go about tracking down the offending DLL.

第一步是运行DUMPBIN.EXE(使用VS命令提示符来得到它的PATH)的可执行文件,以确保该架构是你所期望的: DUMPBIN.EXE /头FOO。 exe文件。在文件头的输出,你应该看到86或64的机器的价值。在可选头的输出,你应该会看到一个神奇的PE32(用于x86)或PE32 +(针对x64)的。

The first step is to run dumpbin.exe (use a VS command prompt to get it on the PATH) on the executable to ensure the architecture is what you expect: dumpbin.exe /headers foo.exe. In the file header output, you should see a "machine" value of "x86" or "x64". In the optional header output, you should see a magic of "PE32" (for x86) or "PE32+" (for x64).

下一步是运行适当的依赖学步车,可在 www.dependencywalker.com ,根据架构(x86或x64 )可执行的。这个工具应该告诉你,如果它定位上是一样的架构而不是搜索路径的依赖。

The next step is to run the appropriate dependency walker, available at www.dependencywalker.com, depending on the architecture (x86 or x64) of the executable. This tool should tell you if it locates a dependency on the search paths that is not of the same architecture.

如果依赖学步车发现问题,该修补程序将被以相同架构的库替换有问题的库或确保正确的库位于基于搜索路径不正确的库之前。

If dependency walker finds a problem, the fix would then be to replace the offending library with a library of the same architecture or ensure the correct library is located before the incorrect library based on search paths.

 
精彩推荐
图片推荐