Help with OpenGL in RedHat 9


I’m a newbie to Linux and I recently started using it because I want to make OpenGL games. I tried installing Mesa myself, but I keep getting fifty or so “undefined reference to <function>” errors when I make my makefile.

Could someone please email me at and tell me how to properly install Mesa? I am running RedHat 9.1 on a P4.

Thanks in advance! (You all rock!)

I’ll post here rather than e-mail you, so others having the same problem can know what’s going on:

More than likely, you have installed Mesa correctly. The undefined reference errors are caused by the fact that you did not link to the libraries. Make sure that you are linking to the libraries in your Makefile by including the -l option, like so:

-lGL -lGLU -lglut

If the libraries are not in /usr/lib (and glut probably is in /usr/local/lib) you will need to make a symbolic link to them:

ln -s /usr/local/lib/ /usr/lib/

or some such (and as root, of course). Enjoy!


I am also having trouble installing Mesa 6.0 on my system (RH 9). I get the following types of errors which appear related to glx (see below). Prior to these errors the compilation seems to proceed ok. Any thoughts?

drivers/x11/glxapi.c: At top level:
drivers/x11/glxapi.c:1036: parse error before ‘*’ token
drivers/x11/glxapi.c:1037: glXBindTexImageARB' declared as function returning a function drivers/x11/glxapi.c: In functionglXBindTexImageARB’:
drivers/x11/glxapi.c:1039: dpy' undeclared (first use in this function) drivers/x11/glxapi.c:1041:False’ undeclared (first use in this function)
drivers/x11/glxapi.c:1042: dereferencing pointer to incomplete type
drivers/x11/glxapi.c:1042: pbuffer' undeclared (first use in this function) drivers/x11/glxapi.c:1042:buffer’ undeclared (first use in this function)


Okay, I tried making the link like you said, but it’s still not working. I don’t think I’m linking correctly. (I’m a hardcore newbie! ) Here is some more information that might be helpful:

o I installed Mesa to /home/alex/Mesa60
o Mesa’s directory has three subdirectories: include, progs, and src
o Inside the include directory is a GL directory, and inside of that are two files glutf90.h and glut.h
o My compiling command in my makefile is:
gcc -Wall -c -g -l/home/bob/Mesa60/include $(OBJS) -o runme

Using that info, where do I need to make symbolic links and what should my command to compile be?

Thank you so very much for all your help!

> o I installed Mesa to /home/alex/Mesa60

Oops! That should say “I installed Mesa to /home/bob/Mesa60”

My bad!


Copy or move the Mesa include files to /usr/include/GL:

cp /home/bob/Mesa60/include/GL/* /usr/include/GL/

Or you can move them or link to them, whatever you prefer. This will make your life easier when you program, so you can just #include <GL/glut.h> rather than #include </home/bob/Mesa60/include/GL/glut.h>. Also, you will need to find out where on your system the other include files you need are, such as gl.h, glx.h, glu.h, etc. and do the same thing with them.

The -l option in your Makefile needs to point to an actual library, not just the directory where they are located. I don’t know what names Mesa uses, since I haven’t used it, so you’ll have to look in /usr/lib or /usr/local/lib to find out. They’ll likely be called something ending in .so.3.8 or some such, like or The name between the lib and the .so is the name you need to invoke with the -l option, for example:

-lGL -lMesa

And so on. ProfX:

It looks like coding errors, rather than anything that you did wrong. Are you using an RPM file, or compiling from source?


Just an FYI that you probably already know, but you do not need Mesa if you are using an nvidia card…

Just install the nvidia drivers and use the included header files.

Happy Coding

>Just an FYI that you probably already know, >but you do not need Mesa if you are using an >nvidia >card…

Yeah, that would be pretty sweet, but my video card is on the mobo, so it’s an Intel 845 chip or something like that. So Mesa it is!

Thanks for posting that though; I’m sure it will help another poor, lost newbie like myself.

Thanks, SPD, I’ll give it a try!

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.