FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

library search order

 
Post new topic   Reply to topic     Forum Index -> Derelict
View previous topic :: View next topic  
Author Message
mwarning



Joined: 01 Apr 2007
Posts: 56

PostPosted: Sun Apr 19, 2009 8:39 pm    Post subject: library search order Reply with quote

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
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Apr 20, 2009 4:11 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
mwarning



Joined: 01 Apr 2007
Posts: 56

PostPosted: Mon Apr 20, 2009 5:35 am    Post subject: Reply with quote

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
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Mon Apr 20, 2009 7:20 pm    Post subject: Reply with quote

That's a really odd error. Are you doing something like DerelictSDLMixer.load("./libogg.so")? If so, don't Smile
_________________
The One With D | The One With Aldacron | D Bits
Back to top
View user's profile Send private message Send e-mail
mwarning



Joined: 01 Apr 2007
Posts: 56

PostPosted: Tue Apr 21, 2009 2:55 am    Post subject: Reply with quote

Code:
That's a really odd error. Are you doing something like DerelictSDLMixer.load("./libogg.so")? If so, don't Smile


.. maybe. Laughing

How can I do it otherwise?
Back to top
View user's profile Send private message
aldacron



Joined: 05 May 2004
Posts: 1322
Location: Seoul, South Korea

PostPosted: Tue Apr 21, 2009 4:37 am    Post subject: Reply with quote

You don't need to Smile 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
View user's profile Send private message Send e-mail
mwarning



Joined: 01 Apr 2007
Posts: 56

PostPosted: Tue Apr 21, 2009 6:36 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Derelict All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group