Telling a program to use the shared library in the program's directory.
I noticed UT2004 for linux comes libSDL[etc].so in the game's bin directory and sticks to it instead of the one in /usr/lib. (I removed the one in /usr/lib and the game still worked, and when I removed the one in ./ut2004/bin the game said it couldn't find the shared lib) How can I do to specify a program which shared library to use or where to find it at compile time?
[size="2"]I like the Walrus best.
Most likely UT2004 starts with a script which modifies some environment variables so that libraries are first searched in the directory of UT2004, then the real executable gets run. You should try to open the thing you call to start up ut2004, with a text editor.
Some googling turned up some
info on how to do this (goto section 3.5).
Some googling turned up some
info on how to do this (goto section 3.5).
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
Hello owl,
As George2 says if it uses a script then that that.
change the LD_LIBRARY_PATH order.
But programs can load in a shared library at run time by doing it themselves instead of the system calling the linker automatically at program load.
Two ways to use a shared lib.
1) Link it in at compile time, this stores the library name the program will load up before running. The system actaul does the loading for you, by calling the linker with the names of libraries needed.
You can use ldd to see a list of shared libraries an exe uses.
2) If the library is not listed then the program must be loading it in itself. This is done by dlopen and then your call the other dl* function to link and mapped the functions you want.
Note: I not a Linux user but you should have something like ldd and dl* on Linux.
Lord Bart :)
As George2 says if it uses a script then that that.
change the LD_LIBRARY_PATH order.
But programs can load in a shared library at run time by doing it themselves instead of the system calling the linker automatically at program load.
Two ways to use a shared lib.
1) Link it in at compile time, this stores the library name the program will load up before running. The system actaul does the loading for you, by calling the linker with the names of libraries needed.
You can use ldd to see a list of shared libraries an exe uses.
2) If the library is not listed then the program must be loading it in itself. This is done by dlopen and then your call the other dl* function to link and mapped the functions you want.
Note: I not a Linux user but you should have something like ldd and dl* on Linux.
Lord Bart :)
Excellent! Thanks!
rattin'++ for your helpful help both :)
rattin'++ for your helpful help both :)
[size="2"]I like the Walrus best.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement