I've done a lot of research over the last two days, and I must have read through at least 20 successfully answered questions on this website alone. None of the solutions seem to work for me. I'm using five frameworks in my application, and I have no problem running it on my computer. When I try to run the application on another computer I get an error loading the libraries.
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: /Users/USER/*/Allegro-5.0.framework/Versions/5.0.7/Allegro-5.0
Referenced from: /Volumes/VOLUME/Pong.app/Contents/MacOS/../Frameworks/AllegroMain-5.0.framework/AllegroMain-5.0
Reason: image not found
I've done these steps:
- I have a copy files build phase that copies the frameworks into the application bundle
- I've used install_name_tool to change the install path to @executable_path/../Frameworks
- I've set @executable_path/../Frameworks as a runpath search path
- The frameworks are linked to my program
It looks like dyld successfully loads the first framework (Allegro-5.0) but thinks it hasn't when it tries to load the second framework (AllegroMain-5.0)
Additional information:
- Currently running OSX 10.7.5
- Xcode version 4.6
What my the contents folder of my application bundle looks like: Contents Screenshot
My link binary with libraries and copy files build phases: Xcode screenshot
I'm not positive that I'm right about the cause of the error. I already appealed for help at allegro.cc but was basically told that they can't help me with a framework specific problem. I'd really appreciate any help with figuring this out!
EDIT
I'm not sure if this matters but I thought about it a bit more and there may be a problem with my header search paths. For the application to run, I have to create a new header search path for each framework. I have these five separate header search paths currently set:
/Library/Frameworks/Allegro-5.0.framework/Versions/Current/Headers
/Library/Frameworks/AllegroMain-5.0.framework/Versions/Current/Headers
/Library/Frameworks/AllegroDialog-5.0.framework/Versions/Current/Headers
/Library/Frameworks/AllegroFont-5.0.framework/Versions/Current/Headers
/Library/Frameworks/AllegroTTF-5.0.framework/Versions/Current/Headers
I'm unsure of exactly how runpath search path works; will it allow the code to find my headers? The error message doesn't seem like the problem is related to this, but this was another thought that occurred to me.
UPDATE 4/14
Something I did messed something up, because I started getting strange behavior even on my computer. I reinstalled the frameworks, and I'm getting a new error.
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Application Specific Information:
dyld: launch, loading dependent libraries
Dyld Error Message:
Library not loaded: /opt/local/lib/libfreetype.6.dylib
Referenced from: /Volumes/VOLUME/Pong.app/Contents/MacOS/../Frameworks/AllegroTTF-5.0.framework/Versions/5.0.10/AllegroTTF-5.0
Reason: image not found
My question is more general now: If I bundle libfreetype with my application, how can I tell the framework where to find it?