5

Hello sage keepers of the arcane art of dylib linking,

I am trying to build an osx application using python, pygame, and py2app. The game works just fun when I run it from the source, but when I pack it together with py2app it fails to find the libvorbisfile.dylib

pygame.error: Failed loading libvorbisfile.dylib dlopen(libvorbisfile.dylib, 2): image not found

libvorbisfile and all of its dependancies are in the Frameworks folder that py2app generates (although I had to explicitly tell it to put them there).

When I examine the id of libvorbisfile.dylib with otool -D it shows that it is relative to my application

@executable_path/../Frameworks/libvorbisfile.3.dylib

The same is true for all of its deependancies. Even so, the game is clearly looking for the .dylib in the /usr/local/lib folder. If the file is there (and has the right install name settings) then everything works.

Here are my actual questions: 1) How can I tell my application to use the dylib in my frameworks folder? - I suspect that I need to use install_name_tool -change to link something to my project relative dylib, but I don't know what to use it on. Is it the file that launches my application? is it some other .dylib? is it SDL (backend for pygame)? is it cocoa? That leads us to question 2:

2) How can I find out what exactly is looking for my dylib?

Other potentially relevant information: When I origionally installed libvorbis I installed it along with the sdl_mixer that pygame depends on

brew install sdl_mixer --with-libvorbisfile

I have tried building on both osx 10.10 and osx 10.7.5

Any and all wisdom would be appreciated.

jrowe_fl
  • 53
  • 4

0 Answers0