View Full Version : 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 email@example.com and tell me how to properly install Mesa? I am running RedHat 9.1 on a P4.
Thanks in advance! (You all rock!) http://www.opengl.org/discussion_boards/ubb/smile.gif
01-28-2004, 09:40 PM
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/glut.so.3.7 /usr/lib/glut.so.3
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 function `glXBindTexImageARB':
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! http://www.opengl.org/discussion_boards/ubb/smile.gif ) 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! http://www.opengl.org/discussion_boards/ubb/smile.gif
> o I installed Mesa to /home/alex/Mesa60
Oops! That should say "I installed Mesa to /home/bob/Mesa60"
01-30-2004, 12:08 PM
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>. http://www.opengl.org/discussion_boards/ubb/smile.gif 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:
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?
01-30-2004, 02:45 PM
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.
>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! http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks for posting that though; I'm sure it will help another poor, lost newbie like myself. http://www.opengl.org/discussion_boards/ubb/smile.gif
Thanks, SPD, I'll give it a try! http://www.opengl.org/discussion_boards/ubb/smile.gif
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.