linking problem

Hi.
I got some problem while linking an opengl program using glut:
g++ camera.o campath.o group.o light.o load_3ds.o load_model.o load_obj.o load_rgb.o main.o material.o mesh.o model.o node.o objet.o renderer.o satellitecamera.o scene.o skybox.o targetcamera.o teapot.o terrain.o texture.o tranform.o tvertex.o vecteur.o voxel.o -o …/bin/moteur.exe -lm -L/usr/lib -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lGL -lGLU -lglut -lXmu
/usr/lib/libglut.so: undefined reference to glXBindChannelToWindowSGIX' /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 glXQueryChannelDeltasSGIX’
/usr/lib/libglut.so: undefined reference to glXChannelRectSyncSGIX' /usr/lib/libglut.so: undefined reference to glXChannelRectSGIX’
/usr/lib/libglut.so: undefined reference to XFreeDeviceState' /usr/lib/libglut.so: undefined reference to XOpenDevice’
/usr/lib/libglut.so: undefined reference to glXQueryChannelRectSGIX' /usr/lib/libglut.so: undefined reference to XSelectExtensionEvent’
collect2: ld returned 1 exit status
make: *** [all] Error 1
that’s all what it say and I just link to these libs :
LIBS=-lm -L/usr/lib -L/usr/X11/lib -L/usr/X11R6/lib -lX11 -lGL -lGLU -lglut -lXmu
anyone got an idea?
I’ve tried to link with glx but it just find some more errors
for my libs and header I have the NVIDIA drivers and libs and I have copiled glut 3.7 from SGI

This is (partly?) a problem with GLUT. I have heard this discussion before regarding the GLUT version supplied with RedHat (and they decided to discontinue GLUT support because of this).

Basically, you have to rebuild GLUT for your system, since some the support of some of the calls (specifically the “glX/Channel” calls) are made at compiletime. An alternative is to get/use the version of GLUT supplied with Mesa, since it has fixed these bugs (support check is done at runtime).

I tried to compile glut 3.7 from the SGI source code but still doesn’t work .
It also seems that mesa no longer make their glut version but only links to the SGI’s one
I’m going to try with glut 3.6 and tell you if it work but if you got any other idea…

well…not working with glut 3.6
is there any options or something else to specify when building glut to make it working??

well glut 3.7.3 is available since Mesa 3.2. So you could still use it (I think).

Otherwise, I took a look at your errors, you still got plenty X errors !! You may not link with all full X libs ! That may be your problem… I know normally glut doesn’t need to link with X (or may be do it internally).
And you have glx link problems too, this mean you are not correctly linking with x,glx. Try to link as if your programm were full X glx (and add -lglut too).
Well, i’m surely wrong as all post due to RH, but it may be a way to find another thing.

hope this help

jdf

I have already tried this but it still giving more and more error for other libs and finally don’t works…
and also I’ve already managed to make the compilation working with only glut but at this moment I had no idea of how it work (like one reboot after many compilation and surprise !!!)
and all my progs linked with this haven’t got any lighting working (but lighting was working before)
then I’ll try something else…but don’t know what for the moment…

ok it compiles now having installed the libglut slackware package but still got some strange effects in my progs (no lighting and strange z-buffer behaviour)…

well… try a mandrake !!
no mandrake 9.0 has some problems too (not in fact for gl, but for programming). There are 2 versions for autoconf, automake that are not compatible… But this is the way of evolution.

If you don’t want to change your distro, you could try to reinstall all what on and over X. use sources. (you may not need to reinstall X in fact).

And how work a full glx prog ?

in fact I’ve only tried my 3d engine which I have written under windows using opengl glu and glut and it was working but here it seems that it doesn’t have the same behaviour probably something to change in my sourcecode .
I’m going to try some small linux tutorial to see if it comes from me or from the NVIDIA drivers

I just installed RedHat 9.0, I tried recompiling the glut release 3.7-12 which come it… but got the errors.

I went back to the glut I was using with Redhat 8.0 and installed them everything works fine now.

The one I used is glut-3.7-4, some also said that glut-3.7-8 also works ok

Just download the RPM for the glut runtime and glut devel librarys.

rpm -i --force glut-3.7-4.i386.rpm
rpm -i --force glut-3.7-4.dev.rpm

Note I may have the file name not 100% correct since I am not posting this from the linux computer.

Originally posted by m0rg:
in fact I’ve only tried my 3d engine which I have written under windows using opengl glu and glut and it was working but here it seems that it doesn’t have the same behaviour probably something to change in my sourcecode .
I’m going to try some small linux tutorial to see if it comes from me or from the NVIDIA drivers

ok in fact everithing is ok it come from my engine (some different defaults values than under windows I guess and it also seems to run very quicker than under windows
really great linux

I am having the same link problem you were having (http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001014.html)

Could you post your compile/link steps or a makefile so I can see how you fixed this?

… skip it

[This message has been edited by Iceman (edited 06-24-2003).]

In fact I’ve done nothing .
After many test rebuilding from source etc, I’ve found a slackware glut package which was working quite well with this makefile:
BASEDIR=…
INCDIR=$(BASEDIR)/include
LIBDIR=$(BASEDIR)/lib
BINDIR=$(BASEDIR)/bin
SRCDIR=$(BASEDIR)/src
SOURCES = $(wildcard *.cpp)
OBJS = $(SOURCES:.cpp=.o)
PROG = moteur

VPATH=$(SRCDIR):$(LIBDIR):$(INCDIR):$(BINDIR)
CC = g++
CFLAGS = -I $(INCDIR) -DDEBUG -Wno-deprecated -Werror -Wall -ansi -pedantic
#LIBS =-lm -lopengl32 -lglu32 -lglut32#WINDOWS

LIBS=-lm -L/usr/X11R6/lib -lglut -lGL -lGLU -lX11 -lXi -lXmu

all: $(OBJS)
$(CC) $(OBJS) -o $(BINDIR)/$(PROG) $(LIBS)

%.o : %.cpp
$(CC) $(CFLAGS) -c $<

run:
$(BINDIR)/$(PROG)

clean:
-rm $(OBJS) ./…/bin/$(PROG)

Thanks. I got it to work.

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