how to
How to compile OpenGL with Microsoft's visual studio 6.
May 8, 2014
page 1 (unfinished)

(the following is still just a rough sketch of
how to get opengl working with VS6)


On numerous occasions I have had to start an OpenGL project from within a windows application. These are directions on how to get that started.

A good source of online information can be found here: OpenGL

In addition to the OpenGL api, I use the glut api to help deal with the window and keyboard controls.

This howto assumes you have the following minimum setup:

     Windows XP SP2

     Microsoft's visual studio version 6 (MS Visual C++ 6.0)

     OpenGL with the included files listed below.


To get MS VC++ going:

file  -->  new  --> Win32 Console App

choose  --> create new workspace


[v] Win32

choose  --> An empty project


then include the code files: (main.cpp, etc...)

project  --> Add to project  --> files


to get opengl to start:

include this file into the project's directory: "glos.h"

include statement:

#include "glos.h"    // MS specific stuff

... the include directory:

C:\Program Files (x86)\Microsoft Visual Studio\VC98\Include\GL


The files opengl32.dll and glu32.dll should already be in your windows system folder. If not then they will need to be placed there... So, to run the executable, you will have to copy the files: opengl32.dll, glu32.dll, and glut32.dll into your system folder:



In order to be able to compile the code using Visual C++, you have to copy the .lib files into the lib folder of Microsoft Visual Studio, which is usually:

C:\Program Files\Microsoft Visual Studio\VC98\Lib

and the .h files into the GL folder:

C:\Program Files\Microsoft Visual Studio\VC98\Include\GL

.. If the GL folder is not found, then create it yourself.


Add the following to the top of the files that are making calls to the OpenGL functions:

      #include "glos.h"         // MS specific stuff

      #include <GL/gl.h>       // system OpenGL includes
      #include <GL/glu.h>
      #include <GL/glaux.h>
      #include <GL/glut.h>    // GLUT support library.


... then we need to modify the library files in visual C++

... project --> settings --> link --> project options


   opengl32.lib glu32.lib glaux.lib glut32.lib /nologo

... then it will link correctly.



I have placed these files here for easy access:

dll files:

( this zip file contains: glu32.dll  glut32.dll  glut.dll  opengl32.dll )



include files:

\GL   GL.H  GLAUX.H  glext.h  GLU.H  glu_.h  glut.h  GLOS.H




Possible errors from MS VC++ 6:


   LINK : fatal error LNK1104: cannot open file "glut32.lib"
   Error executing link.exe


Follow the above folder creations and file placements, then place a good copy of glut32.lib into the directories:

C:\Program Files\Microsoft Visual Studio\VC98\Lib

This should allow the linker to correctly find and open "glut32.lib".



page 1


dark maelstrom icon dark maelstrom
flash games
  t-shirt icon dark maelstrom
t-shirt designs