New to OpenGL in Linux

Hello, last week I dumped windows and put Linux on. I’ll never go back! Now Im not new to OpenGL, but I am to Linux. Now I’m assuming RedHat 7.3 already comes with OpenGL libraries. Where exactly would these be located? Or what implementation do I download? Id like to get started with glut. Also whats a good compiler for programming OpenGL in. My friend says he uses vim for everything, but how good is that for OpenGL. Thanks for your help.

Old GLman

find / -name file.h to search, whatever header file you are lookin’ for. search as root if you dont have read (+r) permissions as your regular user. I have my headers in, /usr/include/ and /usr/X11R6/include/ … //Tyler

[This message has been edited by Error23 (edited 08-05-2002).]

Thanks for your reply. I found the headers and libraries. Any comments on a compiler? Or just personnal preference?

Old GLman

i use gcc-2.95.3 thats my favorite.

Firstly, if you have an nVidia-based card you’re better off downloading their drivers, 'cos you get hardware very-acceleration. I think you’ll find the drivers which ship with RedHat will be Mesa (software rendering).

Secondly, Intels’ compilers are free for Linux for non-commercial use, and are half decent (faster than GCC under some circumstances). Unfortunately they don’t interoperate with GCC if you’re compiling C++ code (groan). But they’re free, and worth a try!

Thanks for your help guys.Yeah the first thing I did when I got RedHat up was install the nvidia drivers! Was a pain, cause I knew nothing about Linux then, but thankfully everything has a readme.

Old GLman

If nvidia drivers (that is, kernel module and GL library) are correctly installed, you can use gcc to play with it.

You can open an openGL windows in X directly with GLX, or use GLUT or SDL to ease the process.

Anyway, VI is great and VIM is the greatest ! Real programmers do not use IDE, they need VI*P0wA !! :slight_smile:

Ok, Im having some trouble getting started here. Where can I find the Mesa implementation of Glut? Specifically glut.h. I downloaded the latest Glut source, but even following the instructions, getting that setup is beyond me at the moment.

Also what exactly is GLX? What exactly is DRI? What exactly should I be using!? Im still a newbie when it comes to compiling stuff in linux. Thanks for help.

Old GLman

GLX is the OpenGl implementation… for X.

DRI is an interface for fast access to hardware without all the overhead of linux kernel. With you have a NVIDIA card you dont need DRI since NVIDIA drivers are independent of it.

If you have an ATI board, go to

you dont need to know where glut is… just use -lglut at compiler options and include <GL/glut.h>… the standard includes directory is default in linux and GCC will look there.

To compile premade software just execute the makefiles that come with them.

to compile your stuff use gcc -lLIBRARY_U_DESIRE_TO_LINK -o OUTPUT_NAME SOURCE.CC

for more information use man gcc.

And gcc is by far the best compiler for linux… especially 3.0 Very fast… very good at templates solving.

It depends on your hardware what implementation you should use. My advice is to not install anything new before you know that it is the right step.

It is probably a good idea to spend a day or two getting comfortable with the system. Here is some sites I like

Also experienced similar problem, currently using Mandrake 8.0.

I’m new to openGL, also considered a newbie to Linux.

Installed Mesa-4.0.3 and then the Nvidia GLX drivers and kernel.

Tried compiling lesson1.c from NeHe, but it complained about cannot finding “glut.h” and “glu.h”.

So I browse /usr/includes/GL/ and they are really not there.

Can someone plz enlight…

there was a tarball named gluandglut.tgz which contains GLU and GLUT sources, but its not easy to find it anymore. Thats what I use and it works without trouble.
I still have the tarball on my disk, if someone want it, I can put it somewhere.

please see my post here.

It describes my workarounds for getting a compile environment to work.


If you will use the nvidia OpenGL implementation, do not install MESA, as it can confuse the installer. In fact MESA will be rmoved when installing NVIDIA drivers.

Also avoid mandrake as it usually doesn’t come with all libraries.

[This message has been edited by OldMan (edited 08-09-2002).]


You should use SDL … its very easy …
download this:
then open a console and type:

cd /dir/where/you/downloaded

tar xfz SDL-1.2.tar.gz

cd SDL- <TAB>



su -c ‘make install’

so, now its installed, you have to compile you programs with:

gcc sdl-config --libs sdl-config --cflags SOURCE.CPP -o EXECUTABLE_NAME

you have to include:

hope i helped



mfg codi
a few links for tutorials to opengl&sdl

[This message has been edited by Codemasta (edited 08-12-2002).]


I’m an experienced OpenGL programmer, but I’m relatively new to Linux. Anyways
I’m now using Debian and I’m unsure as to where I should get my drivers from. Debian’s dselect option does not bring up any OpenGL packages, and nVidia does not have any .rpm files for Debian.

any ideas?

They do have tar files though. Just gunzip, tar -xvf them and read the readme’s. I believe that you just type make in the new directories. You’ll need the kernel file, and the GLX file.


For people new to OpenGL and/or GL under Linux, perhaps this link can help:

Of course, the GLFW toolkit can be a good alternative to GLUT. Check it out here:

The GLFW distribution includes example programs and Makefiles for Linux (showing how to link etc).

I use RedHat 7.1 Personal. Never had any problems with installing Nvidia drivers, compiling under non-Nvidia hw with Mesa/DRI - (Ati, Matrox, etc). Everything related to development/OpenGL(and not only this) worked from the first time.
I guess now redhat is considered something as M$ amoung the linux distros - but still it is one of the best
Worth a try…


Hello again.

I wrote a little glut test program. I compile like so:

gcc -L/usr/X11R6/lib -lX11 -lXi -lXmu -lglut -lGL -lGLU -lm -o gluttest gtest.c

My question is why do I have to specify the libraries directory? Isnt it standard like /usr/include/ ?

PS No it hasnt taken me this long to write a simple test program since my original post I’ve been learning linux in general…

Thanks for your help.