How to find libSDLx11.so

Hello,

this is not quite a SDL specific question… How can I tell my program
from where it should load the dynamic SDL lib libSDLx11.so.0.9 from ?

By now I use a small shell script to start my program, which modifies
LD_LIBRARY_PATH. However I was wondering whether there is a smarter way
to solve this.–
Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Karsten Laux writes:

Hello,

this is not quite a SDL specific question… How can I tell my program
from where it should load the dynamic SDL lib libSDLx11.so.0.9 from ?

By now I use a small shell script to start my program, which modifies
LD_LIBRARY_PATH. However I was wondering whether there is a smarter way
to solve this.

I think this will work with egcs

-L/usr/local/SDL/lib -Wl,-soname -Wl,libSDLx11.so.0.9

However, if you start using libtool, it will handle it automagically
for you.

Phil

Karsten Laux wrote:

Hello,

this is not quite a SDL specific question… How can I tell my program
from where it should load the dynamic SDL lib libSDLx11.so.0.9 from ?

By now I use a small shell script to start my program, which modifies
LD_LIBRARY_PATH. However I was wondering whether there is a smarter way
to solve this.


Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Another thing you can try is that.

You can use ldconfig program (man ldconfig). This program allow you
specify several paths where linux should look for a dinamic library.

First, you must add a line in /etc/ld.so.conf with the new path. Then, you

must execute ldconfig as root. Next time, you reboot the computer
everything should be work without to set LD_LIBRARY_PATH variable.

I hope this help--------------------------------------------
Alberto J. Fernandez
afgarcia at gmv.es

Alberto Jose Fernandez Garcia wrote:

Karsten Laux wrote:

Hello,

this is not quite a SDL specific question… How can I tell my program
from where it should load the dynamic SDL lib libSDLx11.so.0.9 from ?

By now I use a small shell script to start my program, which modifies
LD_LIBRARY_PATH. However I was wondering whether there is a smarter way
to solve this.


Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Another thing you can try is that.

You can use ldconfig program (man ldconfig). This program allow you
specify several paths where linux should look for a dinamic library.

First, you must add a line in /etc/ld.so.conf with the new path. Then, you

must execute ldconfig as root. Next time, you reboot the computer
everything should be work without to set LD_LIBRARY_PATH variable.

hmmmm, my problem is that I want to distribute my game in a nice
package. The user should be able to install this package into a
directory of his choice probably into his homedir. (note: any user, not
only root)
So I need a way to specify a relative library search path…

Something like

SDL_SetLibraryPath("../../libs/sdl");
SDL_Init(SDL_Video);

Though, thanks for you hints. :)–
Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

In Hopkins FBI demo, authors do that.

Greetings

Sam Lantinga wrote:

Something like

  SDL_SetLibraryPath("../../libs/sdl");
  SDL_Init(SDL_Video);

I think that’s a great idea. I’ll implement it soon.

Great !–
Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Alberto Jose Fernandez Garcia wrote:

In Hopkins FBI demo, authors do that.

Greetings

yepp, they use a shell script which modifies LD_LIBRARY_PATH and then
starts the game.
This is were my idea with the script comes from :wink:

regards,–
Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Sam Lantinga wrote:

Something like

  SDL_SetLibraryPath("../../libs/sdl");
  SDL_Init(SDL_Video);

This is implemented in the latest CVS snapshot:

Thanks Karsten!

well, I thank you !–
Karsten-O. Laux
klaux at student.uni-kl.de
http://www.rhrk.uni-kl.de/~klaux
UIN 21614933 (Bert)

Something like

  SDL_SetLibraryPath("../../libs/sdl");
  SDL_Init(SDL_Video);

This is implemented in the latest CVS snapshot:

Added a function SDL_SetLibraryPath() which can be used to specify
the directory containing the SDL dynamic libraries.  This is useful
for commercial applications which ship with particular versions
of the libraries, and for security on multi-user systems.
If this function is not used, the default system directories are
searched using the native dynamic object loading mechanism.

Thanks Karsten!

-Sam Lantinga				(slouken at devolution.com)

Lead Programmer, Loki Entertainment Software–
“Any sufficiently advanced bug is indistinguishable from a feature”
– Rich Kulawiec