PDA

View Full Version : problems under Red Hat 9



vihan
04-12-2004, 06:09 AM
Hi,
i'm facing a problem similar to that faced by Tomi in :
http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001219.html

i get a similar error. Even i'm using Red Hat GNU/Linux 9.0 and have installed glut from the rpm's 3.7.12 (glut and glut-devel). My compilation output is :

[root@kkp opengl]# gcc g.cc -o g -lGL -lm -lGLU -lglut
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XGetExtensionVersion'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XFreeDeviceList'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XQueryDeviceState'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XListInputDevices'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XFreeDeviceState'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XOpenDevice'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XmuLookupStandardColormap'
/usr/lib/gcc-lib/i386-redhat-linux/3.2.2/../../../libglut.so: undefined reference to `XSelectExtensionEvent'
collect2: ld returned 1 exit status

i did not quite understand jide's reply. jide if you could please explain again i would be most grateful

someone please help me out
Thanks

-vihan

jide
04-12-2004, 03:00 PM
you simply seem to forget the X library dependencies (-lX...) in your compilation declaration.

vihan
04-14-2004, 12:15 AM
Hi,
i tried out the -lX option but it gives me the following error :

[root@kkp opengl]# gcc g.cc -lglut -lGL -lX
/usr/bin/ld: cannot find -lX
collect2: ld returned 1 exit status

i have XFree86 dev's, libs's and the prog itself. Also X window dev tools and libs. Is there any pacakage(s) in particular i need under Red Hat 9 ? If not i guess somethings's corrupted and i'll clean up my system and do a fresh install.

jide
04-14-2004, 07:06 AM
But did you really look at the message from Tomi as you seemed to ?

http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001219.html

It's explained there !

You need to add:


-lX11 -lXext -lXmu -lXt -lXi -lSM -lICE -lmfor supporting almost all X stuffs, and -lm stands for maths library.

This must help.

vihan
04-15-2004, 11:56 AM
IT FINALLY WORKS!!!!!!

NEVER HAVE i BEEN SOOOO HAPPY IN SEEING A RECTANGLE!!!!

i did a COMPLETE re-install(mostly out of frustration)

i tried : gcc g.cc-o file -lGL -lm -lGLU -lglut

(THANKS A LOT jackhollow on http://www.opengl.org/discussion_boards/ubb/Forum4/HTML/001219.html for telling me)

BUT MOST OF ALL THANK YOU jide FOR BEING SO PATIENT AND ENCOURAGING with a newbie like me.
i WILL WORK HARD and look forward to the next thread :)

catch you later and thanks again :)