Installing OpenGL & GLUT on Windows 98, NT and Win 2K

Installing the OpenGL run-time libraries

The latest OpenGL run-time libraries from Microsoft are included in Windows 98, NT and Win 2K. The files are opengl32.dll and glu32.dll.

Optional

You can install SGI's MMX accelerated OpenGL for Windows. Here's the link:  http://www.berkelium.com/OpenGL/sgi-opengl.html

Click on the license agreement and download opengl2.exe.
Run opengl2.exe. The installer will copy the following files opengl.dll and glu.dll to windows\system. If you have NT or Win 2K the files will be copied to windows\system32.
Run the demos.
Installing developer's header files and libraries for Microsoft's OpenGL
1. Install MS Visual Studio. Visual Studio will install the needed header files and libraries.

Installing developer's header files and libraries for SGI's OpenGL

1. Copy opengl.lib and glu.lib from SGIís directory (usually OGLSDK\lib) to Program Files\ MS Visual Studio\VC98\lib\.
2. Copy gl.h and glu.h from SGIís directory (usually OGLSDK\include) to Program Files\ MS Visual Studio\VC98\include\.

Installing glut

2.Download glut.
3. Unzip glut**dlls.zip.
4. There are two sets of files, one for Microsoft's OpenGL (files with 32 in filenames) and one for SGI's OpenGL (no 32).
5. Copy glut*.dll to
Win 98: windows\system
NT or Win 2K: winnt\system32
6. Copy glut*.lib to Program Files\ MS Visual Studio\VC98\lib\.
7. Copy glut.h to Program Files\ MS Visual Studio\VC98\include\gl.

Building an OpenGL/GLUT program

1. Download Ed Angel's code examples from ftp://ftp.aw.com/cseng/authors/angel/intcg/

2. Start with gasket.c
3. Open Visual C++ and create a new project (File->New-> projects)
4. Select ìWin32 Console Applicationî and name your project gasket or whatever you want. Click OK
5. Select ìAn empty projectî and click finish.
6. Insert project files. Project->Add to Project-> files. Find, select gasket.c
7. Linking libraries.
Project->Settings. Select ìLinkî tab.  In the Object\libraries field, type either of these:
For Microsoft's OpenGL: opengl32.lib glu32.lib glut32.lib
For SGI's OpenGL: opengl.lib glu.lib glut.lib
8. Comment out the line #include <GL\gl.h>. The header file glut.h includes gl.h.
9. Compile your program.

Note 0: If you have problems compiling Angel's programs, do the following:

Comment out the line long random( ), find all occurrences of random( ) and change them to rand( ). Ignore the warning Warning: const 'double' to 'float', may lose information. If you find that warning annoying do the following:

Find the line glColor3f( 1.0, 0.0, 0.0 ) and change it to glColor3f( 1.0f, 0.0f ,0.0f ).
Note 1: For users of SGI's OpenGL. You must comment out the following lines in the header file glut.h
#pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
#pragma comment (lib, "glu32.lib") /* link with OpenGL Utility lib */
#pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
and add the lines
#pragma comment (lib, "opengl.lib") /* link with SGIís OpenGL lib */
#pragma comment (lib, "glu.lib") /* link with SGIís OpenGL Utility lib */
#pragma comment (lib, "glut.lib") /* link with SGIís Win32 GLUT lib */
If you don't make the changes, you'll get linking errors.

Note 3: Getting rid of the console window.

1. Go to Project->Settings->Link->Project Options
2. In the Project Options field find:
/subsystem:console (it's one of the last lines)
change it to
/subsystem:windows /entry:mainCRTStartup
Note that error messages and output will be lost (unless redirected) if you get rid of the console window.

Installing MUI

1. Copy mui.lib to <drive>:\Program Files\Microsoft Visual Studio\VC98\Lib\

2. Create a folder named "mui" and add the file: mui.h
Copy the folder "mui" to <drive>:\Program Files\Microsoft Visual Studio\VC98\include\
3. To use mui in your programs, you need to add mui.lib to your OpenGL/GLut project (Project->Settings->Link->Object/library modules ) and the header file mui.h to your source code.
4. Test using any of these files: mui_test.c, multi_test.c, calc.zip.

If you have problems send e-mail to gvargas@castor.csustan.edu

Credits

I wrote these instructions based on a document written by

David Marsland
MTS, Customer Education
Silicon Graphics, Inc
I lost the link to the original document, so I can't include it.

Guillermo Vargas

created:  06-12-00
Last update: 07-26-00