GLUT HOWTO

This document explains how to set up GLUT to work with your development environment. There are 3 sections, one for each of the major platforms. Each set of instructions is split into two sections. The first section need only be performed once to setup GLUT on your computer. The other needs to be performed each time you set up a new OpenGL project.

Windows

Here we assume you are using Visual C++.

One Time Setup
Download the windows GLUT distribution from http://www.xmission.com/~nate/glut.html .  Make sure you download the bin zip file.

Unzip glut.h and glut.lib somewhere to keep them permanently (i.e. not in your project directory). Unzip glut32.dll somewhere in your path so it will be accessible by all GLUT programs (C:\Windows\system32 will work, or put it someplace and add that directory to your path by right clicking My Computer, clicking Properties, click the Advanced tab, click the Environment Variables, and either edit or add the PATH variable under the User Variables section to contain the location of the file).

1.      In Visual Studio, go to Tools -> Options...

2.      In the Options window on the left select "Projects and Solutions" -> "VC++ Directories".

  1. From the "Show directories for:" drop-down box, select "Include files".
  2. Add a new directory to the list and point it to the directory holding glut.h.
  3. Do the same for "Library Files", pointing it to the directory holding glut32.lib.

Now glut.h and glut32.lib will always be accessible for your projects.

Per Project Setup
To add the library to the list of libraries to link to, go to Project -> Properties...

1.      Select Linker -> Input in the tree on the left.

  1. Add glut32.lib to "Additional Dependencies".

You should now be able to compile a GLUT program. The GLUT header will just be glut.h (i.e. #include <glut.h>). The GL headers will be GL/gl.h and GL/glu.h.