problem with my first program

i brought an opengl learning book and after finishing the first chapter i decided to try out the small programs that were discussed there, im trying to do the first one(draw a single polygon in a window) but i keep getting this error

Cannot open include file: ‘glut.h’: No such file or directory

i downloaded the glut source code from here
http://www.opengl.org/developers/documentation/glut.html and added it to my program but i keep getting the same error, anyone know why it would be doing that?thanks.

[This message has been edited by eastypops (edited 07-11-2003).]

Oh my , what IDE you are using , this is not OPENGL problem rather than IDE familarity.

First of all, have a look into your IDE “include” and “lib” directory , get a idea how your ide directories organize , then you would know what to do first.

As the error states “No such file”, which mean you don’t have the required file to compile the program.

You need to download the GLUT library for you compiler and install it. The glut source file that you downloaded has to be compiled into a library file before it can be used, better that you download a pre-compiled library for you compiler.

Note when posted a compiling problem also tell us what operating system you are using and what compiler that you are using.

If you tell us this information we can point you to the corrent version of the GLUT library for your system and compiler. And how to install it.

Originally posted by eastypops:
[b]i brought an opengl learning book and after finishing the first chapter i decided to try out the small programs that were discussed there, im trying to do the first one(draw a single polygon in a window) but i keep getting this error

Cannot open include file: ‘glut.h’: No such file or directory

i downloaded the glut source code from here
http://www.opengl.org/developers/documentation/glut.html and added it to my program but i keep getting the same error, anyone know why it would be doing that?thanks.

[This message has been edited by eastypops (edited 07-11-2003).][/b]

[This message has been edited by nexusone (edited 07-12-2003).]

Your compiler maintains an include directory, there should be a subfolder gl.
(that’s why it’s #include <gl/glut.h> )

You need a glut.h and copy it into that folder. In MSVC6 this should be something like
C:\Program Files\Microsoft Visual Studio\VC98\Include\gl\

You can get a precompiled glut dll and the header from Nate Robins’ site .

k, i got it working thanks to the advice. i copied the files in glutsource\include\GL to Microsoft Visual Studio\VC98\Include\GL then i downloaded the precompiled .dll and .lib and stuck the lib in Microsoft Visual Studio\VC98\Lib and the .dll in my debug folder and it compiled fine(after fixing a few errors). just wondering is that what i was supposed to do. btw im using msvc 6.

I am not sure about using the .h from the glut source, but when you downloaded the pre-compiled library and dll files, there should have been also a glut.h file with them.

Originally posted by eastypops:
k, i got it working thanks to the advice. i copied the files in glutsource\include\GL to Microsoft Visual Studio\VC98\Include\GL then i downloaded the precompiled .dll and .lib and stuck the lib in Microsoft Visual Studio\VC98\Lib and the .dll in my debug folder and it compiled fine(after fixing a few errors). just wondering is that what i was supposed to do. btw im using msvc 6.