PDA

View Full Version : Where can I get the "opengl.h" ?



Zweistein
05-29-2001, 10:35 PM
Hi,
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 :-(
Please help me!!!

Cu

AndersO
05-29-2001, 11:35 PM
Its

#include <gl.h>

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

Cheers!

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

Zweistein
05-30-2001, 08:06 AM
Sorry, when I trie it like tihs, it doesnt work!!!
Is there a failure in my code?

Bob
05-30-2001, 09:46 AM
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?

Zweistein
05-31-2001, 03:28 AM
Hi, thanks, I'll trie it like that! :-)

Zweistein
06-01-2001, 12:16 AM
Sorry, it still doesnt work.. :-(
Maybe I did a mistake with linking to the files in the options of VC++ ?

Bob
06-01-2001, 12:19 AM
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.

06-03-2001, 12:28 AM
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.

iss
06-03-2001, 08:26 AM
Remember, as alluded to above the include must not only be "correct" in the code, it must actually point to something! http://www.opengl.org/discussion_boards/ubb/eek.gif

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 http://www.opengl.org/discussion_boards/ubb/smile.gif