View previous topic :: View next topic |
Author |
Message |
mwarning
Joined: 01 Apr 2007 Posts: 56
|
Posted: Sun Apr 19, 2009 8:39 pm Post subject: library search order |
|
|
Hi, does someone know in what order folders are searched for libraries?
I have some .so files in the local directory (linux) but they are not used.
I compiled an application in an 32bit environment
and I moved it onto a 64bit platform along with 32bit
SDL libs in the local directory.
Now I get some error message that different sorts of
libSDL_mixer*.so files couldn't be loaded.
But the 32bit libSDL_mixer.so is in the local directory.
(I also have 64bit SDL libs on the system that won't work.)
Is there a way to make this work? |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Mon Apr 20, 2009 4:11 am Post subject: |
|
|
Check out the libdl man files, specifically for the dlopen function, an you should get the info about the default search path. As for the other issues, I haven't a clue. However, you might try using the optional library name argument for the load method, something like:
Code: | DerelictSDL.load("./libSDL.so") |
...or whatever you've named the shared lib in the app dir. _________________ The One With D | The One With Aldacron | D Bits
Last edited by aldacron on Mon Apr 20, 2009 7:21 pm; edited 1 time in total |
|
Back to top |
|
|
mwarning
Joined: 01 Apr 2007 Posts: 56
|
Posted: Mon Apr 20, 2009 5:35 am Post subject: |
|
|
That seems to work so far.
But I get this error
Code: | derelict.util.exception.SharedLibProcLoadException: Failed to load proc Mix_Linked_Version from shared library ./libogg.so |
Any idea what libs I need too load as well?
I have loaded libSDL_mixer.so before libogg.so already. |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Mon Apr 20, 2009 7:20 pm Post subject: |
|
|
That's a really odd error. Are you doing something like DerelictSDLMixer.load("./libogg.so")? If so, don't _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
mwarning
Joined: 01 Apr 2007 Posts: 56
|
Posted: Tue Apr 21, 2009 2:55 am Post subject: |
|
|
Code: | That's a really odd error. Are you doing something like DerelictSDLMixer.load("./libogg.so")? If so, don't Smile |
.. maybe.
How can I do it otherwise? |
|
Back to top |
|
|
aldacron
Joined: 05 May 2004 Posts: 1322 Location: Seoul, South Korea
|
Posted: Tue Apr 21, 2009 4:37 am Post subject: |
|
|
You don't need to All you need to be concerned with is loading the SDL_mixer library, which is the only thing DerelictSDLMixer knows how to load. See how it's trying to load an SDL_mixer function from the ogg shared library in that error message? That's because DerelictSDLMixer knows nothing about, and cares nothing for, libogg.
SDL_mixer, once loaded, will handle everything it needs to on the C side. It could be linking with libogg, or it could by loading it dynamically. Either way, you don't need to know or worry about it in your own code. You do, of course, need libogg on the system somewhere that it can be found, so if you are having link errors with it that's an issue that's well beyond the scope of Derelict. _________________ The One With D | The One With Aldacron | D Bits |
|
Back to top |
|
|
mwarning
Joined: 01 Apr 2007 Posts: 56
|
Posted: Tue Apr 21, 2009 6:36 am Post subject: |
|
|
In that case I can't just ship the library files along with the binary
unless I can convince dlopen to look in the local directory first anyway.
Thanks for the help! |
|
Back to top |
|
|
|