Surprised nobody ran across this yet, but then again, makes sense.
When compiling either the freeglut and GLEW (packages nearly essential of OpenGL graphics development), both have the option to be built as libraries statically or dynamically. When the libraries are built dynamically, you just include the lib in the link line then copy the dll’s over to your binary folder. But when compiled statically, you need to specify GLEW_STATIC and FREEGLUT_STATIC symbols as compile-time defines when compiling the libraries (and be free of dll hell).
The tricky part is when you include those two libraries in another library and then try to compile that combination into a binary. In the case of freeglut, the linker will complain that it can’t find “freeglut.lib”. Which is strange because freeglut static compiles into a library named “freeglut_static.lib” and only the dll version compiles into “freeglut.lib”. Hmmm, why is freeglut looking for the wrong lib? Well, freeglut_std.h line 53 holds the key. If FREEGLUT_STATIC is defined, then there is a pragma to include “freeglut_static.lib” otherwise the pragma points to “freeglut.lib”. So, you need to include the -D FREEGLUT_STATIC in the link line of the final executable’s link line as well.
GLEW also has this problem, but if you forget the -D GLEW_STATIC in the link line of the executable, you’ll get errors about unresolved externals.
And there you have it.
(update: you must also put GLEW_STATIC and FREEGLUT_STATIC in the link lines of the intermediate libraries as well. The chain of libraries from freeglut and glew ALL need to have that compile parameter specified or you’ll get the same errors).