Linking problems or GLX?

I have just installed RH9 and the new NVIDIA drivers. But I get an strange error when compiling:

[sglo@hp gob]$ make
g++ -L/usr/X11R6/lib/ oblig3.o -lGL -lGLU -lglut -lXmu -lXi -lX11 -lm -o oblig3
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to glXQueryChannelDeltasSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to glXChannelRectSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to `glXQueryChannelRectSGIX’
collect2: ld returned 1 exit status
make: *** [oblig3] Error 1

Kan anyone tell me what this means?

Your not linking correctly with the glx libraries.

This is what I usually use:

$ gcc -L/usr/X11R6/lib -lpthread -lGL -lGLU -lglut -lXxf86vm -o foo

If RedHat 9.0 is like RedHat 8.0, you need to install Glut.
It is on one of the CD’s as two RPM files, one file is runtime library and other dev files install both RPM’s.
If you can not find on the CD, it also can be downloaded from RedHat website.

Originally posted by sglo:
[b]I have just installed RH9 and the new NVIDIA drivers. But I get an strange error when compiling:

[sglo@hp gob]$ make
g++ -L/usr/X11R6/lib/ oblig3.o -lGL -lGLU -lglut -lXmu -lXi -lX11 -lm -o oblig3
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXQueryChannelDeltasSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXChannelRectSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to `glXQueryChannelRectSGIX’
collect2: ld returned 1 exit status
make: *** [oblig3] Error 1

Kan anyone tell me what this means?[/b]

Originally posted by nexusone:
If RedHat 9.0 is like RedHat 8.0, you need to install Glut.

It looks like he already has glut installed since he is getting an undefined reference in libglut.so not a undefined reference to libglut.so.

He’s getting undefined references to glx functions. So he needs to figure out the correct lib to link to. Which will probably be -lXxf86vm.

[This message has been edited by PK (edited 04-11-2003).]

Originally posted by PK:
[b] It looks like he already has glut installed since he is getting an undefined reference in libglut.so not a undefined reference to libglut.so.

He’s getting undefined references to glx functions. So he needs to figure out the correct lib to link to. Which will probably be -lXxf86vm.

[This message has been edited by PK (edited 04-11-2003).][/b]

I don’t know C very well, but to me it does not look like a linking problem. I took a look at glx.h (the one from the NVIDIA drivers) and the above mentioned functions are just not there. Since RedHat ships with Mesa I think that they are exposed in Mesas glx.h but they are not supported by NVIDIAs glx implementation. I don’t have any solution but I am quite sure that this is the problem.

These look like calls to extensions.Are these implemented in the current version of glx? I doubt it… What are you using them for anyway?

Ok, here’s a little script I wrote to figure out which .so file these symbols are exported from:

#!/bin/sh

This script hunts through the library directory

you give it (arg 1) and for each .so file in there,

hunts through its dynamic symbol table for arg 2.

for LIB in find $1 -type f -name '*.so*'
do
objdump -TC $LIB | grep $2 > /dev/null
if test $? = 0
then
echo $LIB
fi
done

Now, running this on the first symbol in sglo’s errors:

[john@quartz ~]$ huntlib.sh /usr/X11R6/lib glXBindChannelToWindowSGIX
/usr/X11R6/lib/libGL.so.1.2

ahhhhh … and then there were two. (See my post in this board about trying to get glut running on RH9. Something’s fishy here. Has anyone gotten glut working with RH9?)

—j

I’m using RH 9 with the Xig drivers. I got the same linking errors when trying to compile my game after upgrading. I had to rebuild GLUT from source and everything worked. Hope this helps…
:wink:

I compiled the program wiht the attributs that PK was using, and then it worked. Thanks to all anyway. And, I have installed glut, and I am using glx.h file from nvidia.

[This message has been edited by sglo (edited 04-13-2003).]

HI, i’m using FreeBSD 4.8 with NVIDA drivers and getting the exact same problem.I tried the alternate linking and it still didn’t work. I linked in glx only to get ALOT more undefined references along with those original ones. Anyway, the solution you have posted seems to be to recompile glut?
am I missing something?

For a complete analysis of this problem, view this bug report:

https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90734

Bottom line: Redhat is dropping GLUT from their distribution because of this problem.

FYI - After upgrading to a different laptop with an NVidia card, I expereinced the same problem. Rebuilding libglut from source didn’t help. However, ALL the errors are caused by dependencies within glut defined in lib/glut/glut_vidresize.c within the glut source. If you simply edit glut_vidresize.c, and remove any code within the SGI defs, then rebuild glut - everything works. Hope this helps…

I started to have this problem after upgrading to Redhat 9. I rebuilt the latest GLUT SRPM, that didn’t work. I then tried linking Xxf86vm; I don’t even have that.

<rant>This is the second time I’ve upgraded the kernel and KDE and had problems like this!</rant>

(I have a GeForce 2 and the very latest NVidia drivers installed)

after this code in glut_vidresize.c:
#ifdef GLX_SYNC_FRAME_SGIX
#define GLX_SGIX_video_resize 1
#endif

add this line:
#undef GLX_SGIX_video_resize

(line 26 in glut_vidresize.c)

This fixed my ImportError: /usr/X11R6/lib/libglut.so.3: Undefined symbol “glXBindChannelToWindowSGIX” problem.

~Z~

Theres a quick and easy fix for this in the jahshaka forums!

https://sourceforge.net/forum/forum.php?thread_id=879028&forum_id=76063

-Jah Shaka

I tried the “Quick and Easy” fix, but I still get the following errors:

/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXQueryChannelDeltasSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXChannelRectSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to `glXQueryChannelRectSGIX’
collect2: ld returned 1 exit status
gmake[2]: *** [XMLDriver] Error 1

It sounds like I need to modify glut_vidresize.c as mentioned above. I downloaded glut-3.7.tar.gz and followed the instructions for linux, but I don’t get a .so as I should. Any tips on installing from source (I installed from rpm before)? Have there been any recent developments regarding this bug?

Thanks
Jenny

I fixed my problem. I found that building rpms from source didn’t get rid of the SGI related errors. However, just using pre-built glut-3.7
rpms from www.rpmfind.net worked fine.

i tryed to install the prebuilt rpms from rpmfind and it gave me this message

/usr/lib/libglut.so: undefined reference to `XQueryDeviceState’

is that mean that i have to remove them first ? Does anyone know what function causes this error ??

Hello, to all… not yet with himself to cause to compile the programs with the lib of glut, use rebuild for glut-3.7-12.src.rpm (RH9)… and nothing, I erase I have I did instalacion again, but finally nothing you’re welcome anybody has found the solucion? for the problem with RH9 + glut + nvidia?

example:

g++ glut_tester.o -Wall -ansi -pedantic-errors -o glut_tester -L/usr/X11R6/lib -lpthread -lGL -lGLU -lglut -lXxf86vm -lXmu -lXi -lXm -o foo
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXQueryChannelDeltasSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference toglXChannelRectSGIX’
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/…/…/…/libglut.so: undefined reference to `glXQueryChannelRectSGIX’
collect2: ld returned 1 exit status
make: *** [glut_tester] Error 1

the way i fixed the problem is i removed the RedHat glut rpms, rpm -qa | grep glut then do rpm -e glut-xxx after glut is gone download the source distribution of the glut library then extract it in a directory do ./configure in the main glut directory, after configure is done do cd glut-src and then make, then copy the library file to your /usr/lib and create a symbolic link. This fixed my problem but yours seems a little different.