Where can I get the "opengl.h" ?

I’ve written this code:

#include <windows.h>
#include <glut.h>
#include <opengl.h>
#include <glu.h>

int main (int argc, char** argv)
glutInit (&argc, argv);
glutInitDisplayMode (GLUT_double | GLUT_RGB);
glutInitWindowSize (400, 100);
glutInitWindowPosition (100, 100);
glutCreateWindow (“My OpenGL-Window”);

init ();
glutDisplayFunc (display);

glutMainLoop ();

return 0;


But my compiler tells me:
fatal error C1083: Include-file cant be opened: ‘opengl.h’: No such file or directory

So where can I get this file? I downloaded MS opengl 95, but there was nothing :frowning:
Please help me!!!



#include <gl.h>

And usually its in a subdirectory called GL.
So you might have to write something like <GL/gl.h> …


[This message has been edited by AndersO (edited 05-30-2001).]

Sorry, when I trie it like tihs, it doesnt work!!!
Is there a failure in my code?

The only wrong thing with your code I can see is

#include <glut.h>
#include <opengl.h>
#include <glu.h>

that propaply should be

#include <GL/glut.h>
#include <GL/gl.h>
#include <GL/glu.h>

Otherwise, what does it say when you change the “opengl.h” to “GL/gl.h” and compile?

Hi, thanks, I’ll trie it like that! :slight_smile:

Sorry, it still doesnt work… :frowning:
Maybe I did a mistake with linking to the files in the options of VC++ ?

What does it say? Does it still complain about a missing header or what? Not much we can do unless you tell us what exactly is wrong.

Hey friend,
I think I have solved the problem.
Firstly, check from your computer by using the search facility in the start command to locate where are the gl files. They normally should be in the GL folder of your C++ builder.

Secondly, type the following:
#include <windows.h>
#include <gl/Gl.h>
#include <gl/Glu.h>
#include <gl/glut.h>

Remember -

  1. if your gl file is under the GL folder, you must include the gl/ command.

  2. you must include the windows.h file or else there will be plenty of errors. The gl.h, glu.h files will not be able to run.

  3. you may need to download glut.h file from this site.

That should solve your worries.

Remember, as alluded to above the include must not only be “correct” in the code, it must actually point to something!

The glut.h file should live in an */Include/GL directory. If you’re on WIN32 look at http://graphics.stanford.edu/courses/cs148-99-summer/programming_windows.html