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 abaglio@umd.edu and tell me how to properly install Mesa? I am running RedHat 9.1 on a P4.
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:
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)
d
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?
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 libMesa.so.3.8 or libGL.so.3.8. 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?