Nearly there...

I have been trying to compile the following program:

#include <GL/glut.h>
int main()
{
}

with the command:

gcc -L/usr/X11R6/lib testprog.c -lX11 -lGL -lGLU -lglut -lm

and I get the following error message:

/usr/lib/libglut.so: undefined reference to XGetExtensionVersion' /usr/lib/libglut.so: undefined reference to XFreeDeviceList’
/usr/lib/libglut.so: undefined reference to XQueryDeviceState' /usr/lib/libglut.so: undefined reference to XListInputDevices’
/usr/lib/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/libglut.so: undefined reference to XOpenDevice’
/usr/lib/libglut.so: undefined reference to XmuLookupStandardColormap' /usr/lib/libglut.so: undefined reference to XSelectExtensionEvent’
collect2: ld returned 1 exit status

I am running Debian Potato, Kernel 2.4.2, XFree86 version 4.0.2

When I run openGL programs compiled on my old Red Hat 6.2 system I get:

GLUT: Fatal Error in oldhello: OpenGL GLX extension not supported by display: :0.0

Doing a “locate -i glx” led me to the command “glxinfo” which gives the same sort of bad news:

Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
Error: couldn’t find RGB GLX visual

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat

Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
0x21 24 tc 0 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None
Xlib: extension “GLX” missing on display “:0.0”.
Xlib: extension “GLX” missing on display “:0.0”.
0x22 24 dc 0 0 0 c . . 0 0 0 0 0 0 0 0 0 0 0 0 0 None

How to I get the missing GLX extension for Xlib? DO I need to get a newer version of XFree86? Please help!

Thanks in advance,

Russell

Hello

Ok its been a long time since I have done anything like this… So here goes…

There are 4 things you need to know…

First there is a kernel module for your vidio card (drm (direct rendering manager), check dri.sourceforge.net). on your system type lsmod… you should see something with the name or your video card (unless compiled into kernel)

Next, in your XF86Config file you should have load “GLcore”
load “glx”

Look at your /var/log/XFree86.log file… You should see it, at the bottom if dri is starting ok then you should see dri enabled.

Next, there should be a device /dev for the drm kernel module to talk with… Go check the permissions for that file… if you are tring under anybody other then root…

Last thing to check, if you are login into x with a typical user then su to root, then you have to make sure that the new user can talk with x… so before you su type xhost + to disable the security.

Ok… That is about all I can do, for now… let me know what version of linux are you using, and what cards on each machine… I don’t know anything about redhat or debian… But I should be able to help…

Sorry for the long answer, its really not hard, once you have done it once, you will do it the second time without any problems…

Later

Hi

Thanks for the help, it’s so nice to hear a helpful voice in the
darkness!

My video card is an NVidia Riva Ultra 64 which seems to pose problems
for me finding a dri - this is from dri.sourceforge.net:

“NVidia provides their own closed source, binary drivers. Hardware
specs are not available to the DRI developers and NVidia cards are
therefore not supported by the DRI.”

And judging by lots of the other posts on this list, nvidia provide
their own drivers which I would get from their website.

However, I still think I should be able to compile my bare-bones glut
program, where I get the error messages like

gcc testprog.c -lglut -lGL -lGLU
/usr/lib/libglut.so: undefined reference to `XSomeFunction’

Do I not just need another -l<something> tacked on the end? (-lX11
doesn’t do it)

An update…

I just installed the nvidia drivers, amazed that it just worked first time. At least it seems to have worked, xplanet --animate really spins fast now!

But I still have my linking problem, still can’t compile any opengl code…

Aha!

I have done it.

I had to add “-lXext -lXi -lXmu” to the linking command.

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