The 32/64 bit DLL confusion on Windows 64-bit

Since I’m developing my PhD renderer for multiple target systems (Win32, x64, LInux, …) I started using the excellent freeGlut project for simple OpenGL windowed output.

So after finding the Windows binaries compiled (and maintained) by Max Martin Payne, I look at the contents of the zip file. I was running a 64-bit Windows installation. I had two freeglut.dll’s to copy to a suitable system folder, one for 32-bit, one for 64-bit.

I wanted these libraries to be available system-wide, so into the Windows folder I went diving.

Logically, I thought I’d place the 32-bit dll under C:\Windows\System32, and the 64-bit dll under C:\Windows\SysWOW64, right? Think again – it’s exactly the other way around.

Reason behind this is that SysWOW64 stands for: System Windows (32) On Windows 64. That folder contains 32-bit libraries for several 32-bit programs that have to be run on the 64-bit system. This means that the System32 folder contains all the 64-bit libraries. The reason Microsoft didn’t change the (now utterly confusing) folder name is because a lot of (badly written) software depends on having a System32 folder where it can look for dll’s, and nowhere else. Yes, even if the software is 64-bit. No, it does not make sense.

I thought someone should write this down. On the internet. Because it could have saved me a fair slice of time.

Comments are closed.