Compiling OpenGL Progams Using Visual Studio
Windows does not include GLUT standard, like the lab machines in MLH 301 do. Thus,
getting your OpenGL programs to compile and run is slightly more difficult.
However by following the following steps, you should be able to figure out how to make it work:
- Download GLUT
- Unzip the file.
- Put the file "glut32.dll" into the system directory (Usually: "C:\WINDOWS\system32")
- Put the file "glut.h" into the standard Visual C++ include directoy
- (This should be something like: "C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\Include\gl")
- You've got the right directory if you see a copy of "gl.h"
- Put the file "glut32.lib" into the standard Visual C++ library directory
- (This should be something like: "C:\Program Files\Microsoft Visual Studio.NET\Vc7\PlatformSDK\lib")
- There should be lots of .lib files here, including "opengl32.lib" and "glu32.lib".
- Make sure your Visual C++ project links in the GLUT/gl/glu libraries.
- Menu: "Project -> (your-project-name) Properties"
- Tab: "Configuration Properties -> Linker -> Input"
- Under "Additional Dependancies", add "glut32.lib glu32.lib opengl32.lib"
NOTE: Later in the course, you may also need to install GLEW.
Follow the same directions: install the DLLs into the system directory, the header files in the include
directory, and the library files into the lib directory.
Last Modified: Thursday, August 25, 2005
Chris Wyman (cwyman@cs.uiowa.edu)