Skip to main content
gamedev.net
🔒 Locked

Linux libGL linking problem

Started by subi Sep 26, 2005 at 4:35 PM 6 replies 1.3k views
Original Post
subi
subi
I am running fedora core 4 and i am trying to port one of my windows app's over to linux. I am using KDevelop. when i run my app it is reporting the GL renderer as Mesa GLX Indirect, but i do have the proper ATI drivers installed, glxinfo says ATI. so anyway i check what my program is linking to and ldd says this libGL.so.1 => /usr/lib/libGL.so.1 (0x008a2000) yet when i run ldd on glxinfo it reports the correct one: libGL.so.1 => /usr/lib/ati-fglrx/libGL.so.1 (0x00111000) so i try a very tiny app and create my own Makefile and use these linker options -L"/usr/X11R6/lib" -L -lGL and yep it links against the correct libGL :-). So in KDevelop i put the exact same linker options into Project->Project Options->Configure Options->Linker Flags Yet it still links against the wrong libGL. How do i fix this, it is very obvious it is something in the way KDevelop does things that is causing this. Sorry i am pretty new to Linux programming *edit* fixed typo [Edited by - subi on September 26, 2005 5:02:11 PM]
leonhard
leonhard
You might be mixing up libGL and libGLU here. GLU is the GL Utility Library.

Anyways, this might be dependent on the search order of the paths to your dynamic libraries. That means that your linker switches might be correct, but when running the application, the Mesa library gets loaded because it's found first.
subi
subi
oops sorry i copied and pasted the wrong line in the above post, it should have read

libGL.so.1 => /usr/lib/libGL.so.1 (0x008a2000) not libGLU ;-)

i can do a real nasty quick hack and change the symlink of /usr/lib/libGL.so.1 tp point to the ATI one BUT i don't want to do this
subi
subi
Quote:
Original post by leonhard
You might be mixing up libGL and libGLU here. GLU is the GL Utility Library.

Anyways, this might be dependent on the search order of the paths to your dynamic libraries. That means that your linker switches might be correct, but when running the application, the Mesa library gets loaded because it's found first.


how do i change the search order than?

leonhard
leonhard
You could have a look at /etc/ld.so.conf (/etc/ld.conf on some distros) or run the application with a custom LD_LIBRARY_PATH environment variable set. man ldconfig contains some useful information as well. Symlinking to the correct library might be easiest though.
subi
subi
Quote:
Original post by leonhard
You could have a look at /etc/ld.so.conf (/etc/ld.conf on some distros) or run the application with a custom LD_LIBRARY_PATH environment variable set. man ldconfig contains some useful information as well. Symlinking to the correct library might be easiest though.


i tried setting the LD_LIBRARY_PATH and it still doesn't work, the ld.so.conf allready points to the ati-fglrx directory. I think the best option is to dump that stupid kdevelop, if i use my own Makefile it links to the correct lib without me having to modify any system settings or change any sym links, i know kdevelop is the problem i just can't figure out how to fix it, guess i will ahve to stick with manually creating my own Makefile :-(

leonhard
leonhard
Or try automake for a more distribution friendly approach.
Richy2k
Richy2k
To be perfectly honest i'd just stick to writing my own makefiles. If I do that I know exactly what is going to happen when I type in "make". Automake is pretty good, but I just prefer writing my own makefiles, can be a pain using an IDE like Anjuta or KDevelop sometimes though.

Topic Locked

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

Sign in to reply to this topic.