OT: glu 1.3 trouble on Windows

I have compiled glu 1.3 a long time ago, but there is a slight problem with opengl32.dll

If I put the glu dll in the system folder, then it might cause problems for some people I imagine. If I put it in my exe folder, then I dont know if it will get loaded since opengl32.dll loads glu too and it might load the system\glu32.dll.

And then there is the problem with other app that load glu. If they load befoer my app, what happens.

I also have trouble compiling the whole lib functions as stdcall, but I’ll ask that another place.
Should I place both DLLs in my exe folder?
Will that solve this issue on all Windows?


You say that you compiled your own copy of glu32.dll, so I would imagine that you have the source code for it, right? What’s to say you don’t create a static library to build into your executable instead of linking to dlls?!?! Or for that fact, you could only compile the functions you use to minimize the size of the program and what not. The only things I use from the GLU library are the mipmap and lookat commands, of which I’ve since written my own equivelent functions and don’t even link to the GLU anymore. But if you absoluely have to use the dll form, put your glu32.dll file in the same folder that your program is in. I think (not 100% sure) that by default, Windows will look for any dll needed (reguardless of which and for what purposes) for a application first in the application path, then in the system path (the ‘path’ statement if you want to call it that). So if you leave opengl32.dll in the c:\winnt\system32 directory, and place your copy of glu32.dll in the application directory (say, d:\dev estapp), the program will link to your glu32.dll file, not the one in the system32 directory. Concerning all versions of Windows, I cannot say, but it does work for W2k.


Personally, I’m a little amazed that OPENGL32.DLL references GLU32.DLL, but that’s what “depends” tells me. Queer.

Anyway: the search order for DLLs is well defined. If your app references GLU32.DLL, and OpenGL references GLU32.DLL, then you’ll get the same binary, because the search order is the same, AFAICR.

I’m an avid user of the tesselator, and I’m not in the mood to extract all relevant code and package it nice and tidy … too much headache.

As jwatte said, opengl32.dll needs glu32.dll
Remove glu from system folder and opengl programs dont run anymore! That’s because of the wglUseFontOutline.

As usual, I use dynamic linking. So I imagine if system\opengl32.dll gets loaded first, it will cause system\glu32.dll to get loaded.
(Am I wrong here?)

If I place both into exe path, then the opengl32.dll may not be compatible on all Windows.
This sucks!
I welcome easy solutions!

Search order from MSDN:

The directory from which the application loaded.
The current directory.
Windows 95 and Windows 98: The Windows system directory. Use theGetSystemDirectory function to get the path of this directory.
Windows NT: The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is SYSTEM32.

Windows NT: The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is SYSTEM.
The Windows directory. Use theGetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.

In other words, putting the glu32.dll file in the same path as your exe should work just fine, opengl32.dll will get the same file too.

If that’s true, then there shouldn’t be a problem. I’ll do a small test to be sure.

Thanks all,

Anyone who wants to download the DLL can get it at

I copied it into my system folder and it’s working. I’m not sure what happens if you use gluBuild3DMipmaps. Maybe I need to make a little code change for that one.

Have fun!