Linking problems or GLX?

I am having the same RH9 Nvidia problem. I tried recompiling glut-3.7 from source, and re-installing the rpm to no avail. The solution I found was (with the help of that rather nice library searching script) to link the two libraries Xi and Xmu where I found the missing symbols:

/usr/lib/libglut.so: undefined reference to XGetExtensionVersion' /usr/lib/libglut.so: undefined reference toXFreeDeviceList’
/usr/lib/libglut.so: undefined reference to XQueryDeviceState' /usr/lib/libglut.so: undefined reference toXListInputDevices’
/usr/lib/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/libglut.so: undefined reference toXOpenDevice’
/usr/lib/libglut.so: undefined reference to XmuLookupStandardColormap' /usr/lib/libglut.so: undefined reference toXSelectExtensionEvent’

My solution:

g++ … -L/usr/X11R6/lib -L/usr/lib -lGL -lGLU -lglut -lXi -lXmu

Thanks for your help everyone,

Josh.

I’m using RedHat 9 and glut 3.7 (default rpm that came with RH9)

Doing as mentioned in previous post:

gcc … -L/usr/X11R6/lib -L/usr/lib -lGL -lGLU -lglut -lXi -lXmu

Got rid of the undefined reference to “X…” functions. They seem to be functions specific to XWindows system (probably used from glx.h), and gcc’s linker didn’t know where to find them.

Thanks for fixing this problem.

p.s. When I tried to compile some other sample opengl programs there were a new set of ‘X…’ functions undefined. Oh well, maybe I’ll find them in some other X libs.

[This message has been edited by robysath (edited 12-30-2003).]

Try ‘-lX11’ may also be needed.

Here’s the libraries i used to get rid of my linking problems:
gcc -L/usr/X11R6/lib -L/usr/lib -lGL -lX11 -lGLU -lglut -lpthread -lXxf86vm -lXi -lXmu gl.c -o gl

and here’s the linking errors I got:
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to XGetExtensionVersion' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toXFreeDeviceList’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to XQueryDeviceState' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toXListInputDevices’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toXOpenDevice’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to XmuLookupStandardColormap' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toXSelectExtensionEvent’
collect2: ld returned 1 exit status

yuck, what a mess.

I have been trying to compile a simple OpenGL program and getting the same error as above. I tried compiling glut on RHL9 but got another error (related to pthread). While searching on thge web, in addition to this site I came across another thread on the opengl.org forum:
http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001014.html

As suggested by one of the users, I uninstalled glut and glut-devel and installed version 3.7-4 (from the RHL8 distro). Everyone compiles and runs perfectly fine now! If you are having the above mentioned problems on RHL9, you might want to give it a shot…

oops… sorry I meant 3.7-8… sorry again for the mistake. Here is a pasting of what I followed (more or less… the post mentions grabbing the rpms from Red Hat’s site. I used the ones I had on CD…):

By: jahshaka ( jah shaka )
RE: compiling on redhat 9 ftgl/glut fixes
2003-06-05 01:06
Ok theres a great and easy workaround for this! Basically you need to swap the glut libraries that come with redhat 9 for the ones that come with redhat 8

this is a very simple procedure,

  1. download the files glut-3.7-8.i386.rpm and glut-devel-3.7-8.i386.rpm from redhats website (or any mirror). I got them here:
    [Software & Download Center - Red Hat Customer Portal option](Software & Download Center - Red Hat Customer Portal ption) s=match_partial&search%3Afield%3Aarch=i386%2Ci586%2Ci686%2Cnoarch&search%3Ago=Search

  2. you need to force install them on your system:
    rpm -i --force glut-3.7-8.i386.rpm
    rpm -i --force glut-devel-3.7-8.i386.rpm

  3. erase the old libraries (devel first)
    rpm --erase glut-devel-3.7-12
    rpm --erase glut-3.7-12

  4. repeat step 2 to freshen up the system

  5. type ldconfig to refresh the system libraries

Thats it, works perfectly and also fixes the FTGL problems!

This is what I use

gcc -o program program.c -B /usr/X11R6/lib -lX11 -lXi -lXmu -lGL -lGLU -lm -lpthread -Wno-deprecated

This has worked on gentoo redhat 7, 8, 9, and fedora and mandrake. If you need help writing a Makefile I could do that to.

thanks nukem I was having the same problem :stuck_out_tongue:

hey there, it seems not to be an OpenGL problem. More I would say a gcc <-> RedHat “feature” (You know: it’s not a bug, it’s a feature. ;-}
Shortly I faced a similar behaviour using gcc under a RedHat system.
My solution was just a change of the options in the gcc (g++) command line like this:
>>gcc -I"inc-path" -L"lib-path" -o “out_file” “my_sourcen” -l"used_lib"

changing the order to
>>gcc -I"inc-path" -L"lib-path" -l"used_lib" -o “out_file” “my_sourcen” will result in undefined references

I know, it sounds strange, but try it…

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