OpenGL Install Guide
OpenGL Install Guide
CS148
OpenGL Install Guide
Disclaimer
We will be using OpenGL for all the projects in this class. You can use any platform and
compiler that you wish, but you must make sure that your program works correctly on
Linux before submitting. The TA’s will be grading all projects on the Sweet Hall
Firebirds (in the basement graphics lab). They will not modify your source code to get
your program to run. All sample solutions will run only on Linux, and although we will
try to help you get up and running on any platform, the TA’s are only “officially”
supporting Linux. The easiest path for you is to work on a Linux workstation.
Windows
Install your favorite IDE. This tutorial assumes that you have Microsoft Visual Studio
6.0 (available from the CS Department Software Library as of Autumn 2004) installed on
your machine. See specific IDE guides at the end of this document for more information.
Install OpenGL
OpenGL v1.1 software runtime is included as part of operating system for
WinXP, Windows 2000, Windows 98, Windows 95 (OSR2) and Windows NT. If you
think your copy is missing, the OpenGL v1.1 libraries are also available as the self-
extracting archive file from the Microsoft website, via this url:
http://download.microsoft.com/download/win95upg/info/1/W95/EN-US/Opengl95.exe
Install GLUT
GLUT is not normally pre-installed. You can download it from:
http://www.xmission.com/~nate/glut/glut-3.7.6-bin.zip
Install GLUT by following the instructions in the README file (copy and pasted here):
Copy the files:
1. glut32.dll to %WinDir%\System,
2. glut32.lib to $(MSDevDir)\..\..\VC98\lib
3. glut.h to $(MSDevDir)\..\..\VC98\include\GL.
Use OpenGL & GLUT in your source code
1. Start Visual C++ and create a new empty project of type “Win32 Console
Application.”
2. To test your setup, add a simple GLUT program to the project like
“drawCircle.cpp” from our sample programs.
3. You should only need to #include <GL/glut.h>. It includes the other necessary
dependent libraries. You might need to modify our example programs to fit this
requirement.
Troubleshooting
• If you get an error that says “unexpected end of file while looking for precompiled
header directive”, try turning off precompiled headers by selecting Projects ->
Settings, then goto the C++ tab, select Precompiled Headers from the Category
listbox, then select the "Not using precompiled headers" radio button.
Mac OS X
Install an IDE. Apple includes Project Builder / Xcode on the Developer CD included
with all OS releases.
• If you are using Mac OS 10.1 to 10.5 download and install the April 2002 version
of Project Builder.
• For all Jaguar revisions (v10.2 to v10.2.8) use the Dec 2002 version of Project
Builder.
• For Panther use Xcode.
Specific IDEs
Microsoft Visual Studio .NET 2002 / 2003
1. From the start screen, click on New Project
2. In the C++ folder, choose C/C++ Console Application
3. Copy the source files into the project directory. Add them to the project, and you
should be good! (Make sure to add glui32.lib to your project, just like any other
source file.)