Linking to glx problem

Hi,
I’ve succesfully installed new NVidia drivers and glut-3.7.12 rpms.

Now I have a problem similiar to sglos (posted 4/11/03).

That is, when i try to compile a opengl program, i get the following error messages:

[simon@128-184-88-83 redbook]$ gcc plane.c -o plane -L/usr/X11R6/lib -lpthread -lglut -lGL -lGLU -lXmu -lXi -lXxf86vm
/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

I agree with PK that this is a linking problem, but using PKs suggestion of using -lXxf86vm has not worked.

Any help would be extremely appreciated…
thanks in advance,
Simon

Could this be a LDPATH problem? (not that I know exactly what that is but I seem to remeber having to export PATHS when using Mesa…

What does your ld.so.conf say?

Here’s mine:

/usr/local/lib
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2
/usr/lib/opengl/nvidia/lib
/usr/X11R6/lib
/opt/sun-jdk-1.4.1.02/jre/lib/
/usr/qt/3/lib
/usr/kde/3.1/lib

Maybe you also need to add /usr/lib/opengl/nvidia/lib. But I’m just fishing for answers now.

Try compiling with -L/usr/lib/opengl/nvidia/lib if that directory exists on your system.

thanks for replying PK.

here is the file ld.so.conf:
/usr/kerberos/lib
/usr/X11R6/lib
/usr/lib/sane
/usr/lib/qt-3.1/lib

as you can see this is missing many of your values. can this be manually edited or updated?

also, i don’t have a /usr/lib/opengl directory, and hence no /usr/lib/opengl/nvidia/lib.

here’s a locate nvidia output:
[simon@139-132-20-193 etc]$ locate nvidia
/dev/nvidia0
/dev/nvidia1
/dev/nvidia2
/dev/nvidia3
/dev/nvidia4
/dev/nvidia5
/dev/nvidia6
/dev/nvidia7
/dev/nvidiactl
/var/log/nvidia-installer.log
/usr/bin/nvidia-installer
/usr/X11R6/lib/modules/drivers/nvidia_drv.o
/usr/src/linux-2.4.20-8/drivers/ide/pci/nvidia.c
/usr/src/linux-2.4.20-8/drivers/ide/pci/nvidia.h
/lib/modules/2.4.20-8/kernel/drivers/video/nvidia.o

and here’s an locate opengl output:
/usr/share/doc/SDL-devel-1.2.5/html/guidevideoopengl.html
/usr/include/SDL/SDL_opengl.h

any further suggestions greatly appreciated.
cheers,
Simon

Originally posted by shosking:

as you can see this is missing many of your values. can this be manually edited or updated?

Depends on your distro. In gentoo ld.so.conf is updated by the env-update.

Try to locate these files and make sure that they are in your lib path. Either in the LDPATH variable or ld.so.conf.

cd /usr/lib/opengl/nvidia/lib/ ls
libGL.la libGL.so libGL.so.1 libGL.so.1.0.4191 libGLcore.so libGLcore.so.1 libGLcore.so.1.0.4191

Oh, and by the way, this shared object might be important too.

pwd /usr/lib/opengl/nvidia/extensions ls
libglx.so

I had the exact same linking problems.

I got it working by building the newest Mesa in /usr/local/ and copying the libglut* libraries from src-glut/.lib over the ones in /usr/lib

Not the nicest solution, but it works until Redhat fixes the rpm.

Jamie

Originally posted by shosking:
[b]Hi,
I’ve succesfully installed new NVidia drivers and glut-3.7.12 rpms.

Now I have a problem similiar to sglos (posted 4/11/03).

That is, when i try to compile a opengl program, i get the following error messages:

[simon@128-184-88-83 redbook]$ gcc plane.c -o plane -L/usr/X11R6/lib -lpthread -lglut -lGL -lGLU -lXmu -lXi -lXxf86vm
/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

I agree with PK that this is a linking problem, but using PKs suggestion of using -lXxf86vm has not worked.

Any help would be extremely appreciated…
thanks in advance,
Simon[/b]

Rebuilding the glut rpm fixes the problem.

Originally posted by satan:
Rebuilding the glut rpm fixes the problem.

great. I have not rebuilt an rpm before. I assume that i need to find the glut src rpm and then build with rpmbuild --rebuild *.src.rpm?

I’ll give it a go and let you know how it goes…

anyone know a link to glut src rpms?

http://fr2.rpmfind.net/linux/rpm2html/search.php?query=glut

thanks for everbody’s reply. rebuilding the glut source rpm fixes this problem (thanks satan).

for those who have the same problem, download the glut source rpm for RedHat 9 from the link above, remove existing glut rpms (using rpm -e glut) and build source rpm using rpmbuild --rebuild *.src.rpm.

then go to /usr/source/redhat/RPMS/i386 and install the glut and glut-devel rpms using rpm -i glut*.rpm and glut-devel*.rpm.

thats it.
opengl apps will then compile using:
gcc foo.c -o foo -lglut -lGL -lGLU -L/usrX11R6/lib -lXi -lXm

good luck,
Simon

just wanted to say:

rebuilding glut from the src-rpm did not help in my case.
compiling from the normal glut-37.zip either.

what helped my was simply installing the glut and glut-devel packages from rh 8.0.

you can check if the references are in the so-file with “nm -Bgr | grep glX”.

Using the RH8 RPM’s worked for us,
thanks for the tip!

Solution at bottom …
http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001014.html

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