0

我正在使用 OpenGL 编写一个跨平台的 3D 引擎。过去我使用带有一些扩展的 OpenGL 1,它在 Windows/Mac/Linux 上运行良好。但现在我决定使用 OpenGL 3.3 版本。切换到 OpenGL 3.3 导致我的应用程序在启动时失败。

问题是当我选择 Win32 构建目标时,VS 使用 C:/Windows/SysWOW64 文件夹中的库,这是 64 位库。当我选择 x64 构建目标时,VS 使用来自 C:/Windows/System32 的库。

我在 Windows 8.1 x64 上使用 Visual Studio 2013。

那么它是 Visual Studio 错误,我应该切换到另一个 IDE 来构建 Windows 还是我在 Visual Studio OpenGL 项目配置中做错了什么?

4

1 回答 1

0

The problem is that when I choose Win32 build target, VS uses libraries from C:/Windows/SysWOW64 folder which is 64-bit libraries.

Nope. SysWOW64 contains the 32 bit libraries.

And when I choose x64 build target, VS uses libraries from C:/Windows/System32.

Yes, because the 64 bit libraries are located in System32.

Before you ask "Wait, what?! What kind of drugs got the Windows developers intoxicated with?" let me tell you that this has its very well founded reasons. The problem is, that many programs have the System32 path hardcoded somewhere. And when these programs get recompiled for 64 bit these hardcoded paths remain and even though they're 64 bits, they're looking for the libraries at the System32 location. That's also the reason why the OpenGL interface DLL is named opengl32.dll also on 64 bit systems.

When running 32 bit applications the filesystem name resolution transparently replaces the paths to resolve into the SysWOW64 directory.


So, in your question title you asked about a crash in ntdll.dll. What about that?

于 2015-01-22T23:26:25.897 回答