Problems under Red Hat 9

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

you simply seem to forget the X library dependencies (-lX…) in your compilation declaration.

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.

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 -lm

for supporting almost all X stuffs, and -lm stands for maths library.

This must help.

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 :slight_smile:

catch you later and thanks again :slight_smile:

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