Skip to main content
gamedev.net
🔒 Locked

Library issues

Started by disruption Jan 25, 2006 at 11:49 AM 4 replies 850+ views
Original Post
disruption
disruption
Hi I use Open GL sparingly for visualization. I am running RedHat Enterprise for Linux on a dual processor machine. I could sure use some clarity with regards to libraries, what to use and what not to use. I have been in the past on a different machine been using nehe's tutorial for the basis of what I am doing. However I am running into real problems with compatibility of my new set-up with old code. I believe I have installed GLX and FreeGlut. One can get very basic samples working with free glut. However I seem to have problems with the X - windows routines. This is the compilation output: cc -L/usr/X11R6/lib -lGL -lGLU -lm -lgd Viewer.o -o Viewer /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGL.a when searching for -lGL /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGLU.so when searching for -lGLU /usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGLU.a when searching for -lGLU Viewer.o(.text+0x19e8): In function killGLWindow()': : undefined reference to XF86VidModeSwitchToMode' Viewer.o(.text+0x1a04): In function killGLWindow()': : undefined reference to XF86VidModeSetViewPort' Viewer.o(.text+0x1a76): In function createGLWindow(char*, int, int, int, int)': : undefined reference to XF86VidModeQueryVersion' Viewer.o(.text+0x1aa5): In function createGLWindow(char*, int, int, int, int)': : undefined reference to XF86VidModeGetAllModeLines' Viewer.o(.text+0x1c6b): In function createGLWindow(char*, int, int, int, int)': : undefined reference to XF86VidModeSwitchToMode' Viewer.o(.text+0x1c87): In function createGLWindow(char*, int, int, int, int)': : undefined reference to XF86VidModeSetViewPort' collect2: ld returned 1 exit status make: *** [Viewer] Error 1 --Viewer.cpp head --- * * This code was created by Jeff Molofee '99 * (ported to Linux/GLX by Mihael Vrbanec '00) * * If you've found this code useful, please let me know. * * Visit Jeff at http://nehe.gamedev.net/ * * or for port-specific comments, questions, bugreports etc. * email to Mihael.Vrbanec@stud.uni-karlsruhe.de */ #include #include #include #include #include #include #include "math.h" #include #include #include #include "gd.h" #include "Variables.h" Is there anything obvious that I should try?? It would seem GLX is not work as it should. Does anyone have any pointers to get this rectified. Thanks
haegarr
haegarr
You don't bind with the X11 libraries.

The symbols that are complained to be unknown are from the (lib)Xxf86vm library. I expect you also need to link with the (lib)X11 library.

Try
cc -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm -lX11 -lm -lgd Viewer.o -o Viewer

Btw: Don't known for what (lib)gd is good for.


EDIT: XVid... is an extension of X windows. I assume you may have to take into account that the routines are not installed on all systems running your app!?
disruption
disruption
Hi Thanks for that...

Now it seems that Xxf86vm cannot be found.

/usr/bin/ld: cannot find -lXxf86vm
collect2: ld returned 1 exit status


However when I try and locate the library....

locate Xxf86vm
/usr/X11R6/lib/libXxf86vm.so.1.0
/usr/X11R6/lib/libXxf86vm.so.1
/usr/X11R6/lib64/libXxf86vm.so.1.0
/usr/X11R6/lib64/libXxf86vm.so.1
/usr/X11R6/lib64/libXxf86vm.a
/usr/X11R6/lib64/libXxf86vm.so

It would appear its there.

BTW gd is a library that I have been using to convert images.

Thanks again.
disruption
disruption
Also find when compiling from the prompt:

Am trying this

g++ Viewer.cpp -L/usr/X11R6/lib -lGL -lGLU -lXxf86vm -lX11 -lm -lgd

Get this...

/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGL.a when searching for -lGL
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGLU.so when searching for -lGLU
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libGLU.a when searching for -lGLU
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXxf86vm.so when searching for -lXxf86vm
/usr/bin/ld: skipping incompatible /usr/X11R6/lib/libXxf86vm.a when searching for -lXxf86vm
/usr/bin/ld: cannot find -lXxf86vm
collect2: ld returned 1 exit status

Thanks
haegarr
haegarr
I could assume only...

You're specifying -L/usr/X11R6/lib what is the base directory for the 32 bit libs. But the linker rejects to load the needed libs from there although they are stored therein. You've also installed 64 bit libs. Are you compiling for a 64 bit machine? What happens if you specify -L/usr/X11R6/lib64 instead of -L/usr/X11R6/lib?
disruption
disruption
-L/usr/X11R6/lib64

works fine!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.