Compiling in VC++

I am getting a LNK2001: unresolved external symbol error when I try to compile my project with OpenGL code… It is happening for:
gl_Enable, gl_Disable, gluPerspective, and several other GL functions.

I’ve inlcuded gl.h, glu.h, glaux.h. I don’t know if it’s not finding these or what…

Any advice would be much appreciated!


You have to include the files opengl32.lib and glu.lib in the linker options, or paste this code before calling any GL command:

#pragma comment(lib, “opengl32.lib”)
#pragma comment(lib, “glu32.lib”)