Professional Documents
Culture Documents
The instructions that follow are for the Visual C++® 2008 Express Edition. If you want you can
use the Visual C++® 2010 Express Edition (the instructions should be similar).
Create GL directory
Copy glut and glew headers (glew.h, glut.h, wglew.h) into the GL folder
Now your computer should be ready to build and run OpenGL code.
NOTE: Search for the “opengl32.lib” file in the “lib” folder (with VC 2005 and newer versions this file must
be already installed). If the file is not found on your system, then it must be downloaded and copied in the
“lib” folder.
CREATING PROJECTS
You have now created an empty project to which you can add files and edit them.
To build OpenGL programs, you will have to include the OpenGL, GLUT, and GLEW header
files as well as link against the correct library files.
COMPILING AND LINKING WITH OPENGL SUPPORT
1. In your main source file, remember to #include <GL/glew.h> and #include <GL/glut.h>
2. Click on the project menu and choose the project Properties choice
You have now set up the project to include the appropriate headers and build against the
correct libraries. These particular instructions will treat GLEW and GLUT as "dynamically linked"
libraries. This means that you will have to distribute the glut32.dll and glew32.dll files along with
your program for users without GLUT and GLEW installed. GLEW gives you the option of "static
linking," which allows you to avoid redistributing glew32.dll. To do this, #define GLEW_STATIC
before the #include <GL/glew.h> line. Also choose to link against glew32s.lib instead of
glew32.lib.
SUMMARY
In summary, a fully installed Windows OpenGL development environment should look like this:
File Location
glew.h
glut.h [compiler]\include\gl
wglew.h
Opengl32.lib
glew32.lib
[compiler]\lib
glew32s.lib
glut32.lib
Opengl32.dll (should already be installed on the system – you do not need to install it)
glew32.dll [system]
glut32.dll
Where [compiler] is your compiler directory (such as C:\Program Files\Microsoft Visual Studio
9.0\VC\include) and [system] is your Windows system directory.