I am trying to use geometry shaders in my OpenGL application that is currently using Freeglut, and I am trying to use GLEW to do that because as I understand it, the geometry shader functionality is in an extension. My include order is as follows:
#define GLEW_STATIC
#include <glew.h>
#include "freeglut.h"
However when I do this I get lots of linker errors like the following:
error LNK2001: unresolved external symbol ___glewAttachShader
I do not receive any errors when I only use the basic OpenGL functionality (that it, things that are not in the extensions) so I know that the compiler is finding all the “basic” libraries like glu32 etc. I am using Visual Studio 2008. Any suggestions?
It’s a linker error that says it did not find a glew entrypoint.
Link against the glew library (you did not see the error before because you did not use any extension, I assume).
Edit:
Actually, this is directly related to your usage of “GLEW_STATIC”.
From the GLEW page:
What this says is that it is your responsibility to build and include the glew source files when you use the GLEW_STATIC setup.