Problems loading libraries on MacOS

BlitzMax Forums/BlitzMax Programming/Problems loading libraries on MacOS

Firstdeathmaker(Posted 2008) [#1]
Hi,

I just tried to compile my program that uses the irrklang.lib and bruce's irrklang.mod on MacOS. On windows XP it's doeing well, but not so on MacOS. I always get the error:

Building SoundFileManager
Compiling:SoundFileManager.bmx
Linking:SoundFileManager.debug
Executing:SoundFileManager.debug
dyld: Library not loaded: @executable_path/libirrklang.dylib
Referenced from:
/Applications/BlitzMax/MeineApps/SoundFileManager/SoundFileManager.debug.app/Contents/MacOS/SoundFileManager.debug
Reason: image not found

Process complete

Although I put the files ikpMP3.dylib and libirrklang.dylib in the same folder I compiled my program in.

Can anybody help me? (I'm a total noob on mac-OS, so if this question is stupid please forgive me ;) )


Brucey(Posted 2008) [#2]
You need to put the dylibs *inside* the bundle, into the same folder as the actual binary, which is SoundFileManager.debug.app/Contents/MacOS/ in your case.

On OS X, a .app is really a folder, not the app itself. Inside that folder you can store resources (like images, config, dylib).

If you right-click (or ctrl-click if you have one button mouse) on the .app, you will see something like "Show Contents" in the popup menu.
That should open up a new finder window, where you can browse to the MacOS folder and copy the dylibs into there.

The ones that come with the module have been modified slightly in order to run from inside a bundle. Originally they are set to run from the same folder as a non-bundled app (ie. non-gui app), but that's not much use for us BlitzMax users.

If BlitzMax builds had post-processing then you could automate the copying of the dylibs into the folder.
But once you've copied them in there, they should be there after successive builds.

HTH

Brucey


Firstdeathmaker(Posted 2008) [#3]
Yep, is working now.

Again: Thank you so much!

Chris