Thursday, June 08, 2006

VC++ express opengl gotcha

there's a gotcha with the new "Express Editions" of visual studio. unlike VS.Net, they don't come with OpenGL nicely installed. for example, when tring to use glut.h with VC++ 2005 Express Edition, the result is this build error:

"Cannot open include file: 'GL/gl.h': No such file or directory"

I suppose you could just copy the files (the 'gl' dir) into your project dir, but I haven't tested exactly which files would have to be copied since I have a version of VS.Net already installed - I'll just use that.

here's some background...

Header (.h) files
OpenGL is part of Windows XP and the Visual Studio. Its header files are usually in C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl, so they can be included with the statements:

#include
#include

The GLU (GL Utilities) in glu.h refers to a set of utility functions that make some OpenGL operations easier to program. It is standard on all OpenGL implementations and is generally thought of as part of standard OpenGL.

Tip: Both gl.h and glu.h are included in GLUT, so if glut.h is included in your source file, gl.h and glu.h don't need to be explicitly included.

(from http://www.cs.tufts.edu/r/graphics/resources/OpenGL/OpenGL.htm)

No comments: