0

I am writing a cross-platform 3D engine using OpenGL. In the past I used OpenGL 1 with some extensions and it worked good on Windows/Mac/Linux. But now I've decided to use OpenGL 3.3 version. The switch to OpenGL 3.3 caused my application to fail at start.

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

I use Visual Studio 2013 on Windows 8.1 x64.

So is it Visual Studio bug and I should switch to another IDE for Windows build or am I doing something wrong with Visual Studio OpenGL project configuration?

1 Answers1

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?

datenwolf
  • 159,371
  • 13
  • 185
  • 298