PDA

View Full Version : Trouble with glut ??



erik_f
06-16-2001, 09:02 AM
I have a problem installing glut 3.7 on my mandrake 7.2 box with a tnt2m64. It apparently installs ok, but when i try to compile my program (torus.c from the Opengl Redbook) i get the following:

# gcc -o torus torus.c -lGL -lGLU -lglut

/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 `XFreeDeviceState'
/usr/lib/libglut.so: undefined reference to `XOpenDevice'
/usr/lib/libglut.so: undefined reference to `XmuLookupStandardColormap'
/usr/lib/libglut.so: undefined reference to `XSelectExtensionEvent'
collect2: ld returned 1 exit status

What is wrong here???

kaber0111
06-16-2001, 02:33 PM
i think your missing some crucial libraries to link to?

06-17-2001, 06:36 AM
Perhaps do you want to use the glut from mesa since it allows you to build with your command. The original glut seems to require that you give a lot of other libraries. See http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/000152.html

madskaddie
02-29-2004, 10:25 AM
I usually program under visual c++ but I've programed once in CIGWIN and it gave problems. The resolution was to write:

gcc -o torus torus.c -lglut -lglu -lgl

instead of:

gcc -o torus torus.c -lGL -lGLU -lglut

Try it!!

Rob Fletcher
03-15-2004, 05:56 AM
You'll need other libs as well as the glut and gl libs ...

add in to your link command line

-lX11 -lXi -lXmu -lm

rob