MS Visual C++ 6.0 and OpenGL

I installed Microsoft Visual C++ and it had the following header files under the ‘GL’ directory:
C:…\Microsoft Visual Studio\VC98\Include\GL\GL.H
C:…\Microsoft Visual Studio\VC98\Include\GL\GLU.H
C:…\Microsoft Visual Studio\VC98\Include\GL\GLAUX.H

These are the header files for OpenGL. My first problem is that I don’t have GLUT.H in there. I found that header file off the net and just copied it into the “GL” directory. Is that fine? Or is there more that I have to do to use GLUT? I went to the webpage of the develop of GLUT, but I didn’t understand his instructions for installing GLUT so I just through the header file into that directory, but I doubt that’s all I need to do.

My second problem is that I’m having trouble using OpenGL in MS Visual C++ 6.0. Whenever I create a program such as the following:

#include <gl/Gl.h>
#include <gl/Glu.h>


I can compile it, but when I try and build the ‘.exe’ file I get all these link errors. What am I doing wrong? I hardly have any experience using MS Visual C++ 6.0, because I’ve done all my application development using DJGPP C++ and using EditPlus as a text editor for my C++ code.


Okay, I figured out the whole “Linking” problem for a tutorial I found, but I’m still confused about installing GLUT.

Hi there,
i was also facing the same problem few days before, butnow it alright.
U r doing the right thing, just copy the GLUT.H from the web and copy it in the directory.
C:…\Microsoft Visual Studio\VC98\Include\GL\GLut.H
and similarly copy glut.lib and glut.dll and place them in the following positions.

C:…\Microsoft Visual Studio\VC98\Lib\GLut.lib

I think then everything should be fine.


always include windows.h before gl.h
#include <windows.h>
#include <gl/gl.h>
#include <gl/glu.h>

People are still including windows.h before gl.h because of a couple of defines?

You can download fixed gl.h
Also has the latest glext.h


Also, you have to add this libraries to link your project in “Project->Settings->Link->Object/Library modules”:

gl.h-> “opengl32.lib”
glu.h-> “glu32.lib”
glut.h -> “glut32.lib”

Originally posted by V-man:
[b]People are still including windows.h before gl.h because of a couple of defines?


What’s wrong with that? If you’re using glut, you can just include glut.h and there is no need to include gl.h separately. But if you’re using the Win32 API, you need windows.h anyway, so you just have to be sure to include it before gl.h.