PDA

View Full Version : Linking opengl on linux



dovkruger
01-16-2004, 01:46 PM
I've been using Mesa-5.1 on Redhat 9, which works, but it's slow. Now that I realized that I'm not using the opengl libs, I'm trying to link. I use the command:

g++ -Wall -march=i686 -g -I /usr/share/doc/NVIDIA_GLX-1.0/include/ -o Dov2b -L /usr/lib -L /usr/X11R6/lib -L/usr/local/lib Dov2.cc -lGL -lGLU -lglut

/usr/local/lib/libglut.so: undefined reference to `XGetExtensionVersion'
/usr/local/lib/libglut.so: undefined reference to `XFreeDeviceList'

... etc.

I have tried looking for these symbols in both header files and libraries but can't find them.

A related issue is that I can't seem to build libglut, so I am using one that may be part of Mesa.
Can anyone help, please?

thanks,
Dov


[This message has been edited by dovkruger (edited 01-16-2004).]

dorbie
01-16-2004, 04:09 PM
You link to gl, glut and glu but you don't link to X11 (you merely add the dir to your link path), try adding -lX11 . I'm surprised you missed so few symbols. Have a look at the link line that the GLUT examples & other makefiles spit out. AFAIK Mesa can emulate GLX in software so that's probably why you got away with it.

The linux forum is a better place to ask this stuff since they'll be a lot more familiar. Your next question might be (depending on your hardware & setup) how to get hardware acceleration through the DRI running correctly because you're still in software despite using the standard ABI :-). So that's where you should ask it if you need to.

[This message has been edited by dorbie (edited 01-16-2004).]

nexusone
01-16-2004, 05:00 PM
There is a bug in the GLUT library shipped with RedHat 9, look in the linux forum for the work around.


Originally posted by dovkruger:
I've been using Mesa-5.1 on Redhat 9, which works, but it's slow. Now that I realized that I'm not using the opengl libs, I'm trying to link. I use the command:

g++ -Wall -march=i686 -g -I /usr/share/doc/NVIDIA_GLX-1.0/include/ -o Dov2b -L /usr/lib -L /usr/X11R6/lib -L/usr/local/lib Dov2.cc -lGL -lGLU -lglut

/usr/local/lib/libglut.so: undefined reference to `XGetExtensionVersion'
/usr/local/lib/libglut.so: undefined reference to `XFreeDeviceList'

... etc.

I have tried looking for these symbols in both header files and libraries but can't find them.

A related issue is that I can't seem to build libglut, so I am using one that may be part of Mesa.
Can anyone help, please?

thanks,
Dov


[This message has been edited by dovkruger (edited 01-16-2004).]