Problem embedding a custom framework inside an .app bundle with XCode 4
I've been searching the web (and S.O.) for a while before asking this question. But I'm totally stuck and I don't know how to fix this.
I have to embed a custom framework inside an .app bundle, using XCode 4. I know I have to fix the install path of the framework using the install_name_tool
utility. I've done it like this:
install_name_tool -change /Library/Frameworks/Ogg.framework/Versions/A/Ogg @executable_path/../Frameworks/Ogg.framework/Versions/A/Ogg <input framework>
I've verified that the framework was actually processed by looking at the "last modified" timestamp of the file.
Now the problem: the framework gets copied into the app bundle, but when I run the application, it crashes and in the error report it tells that /Library/Frameworks/Ogg.framework/Versions/A/Ogg
image could not be found. Please note the wrong name.
I'm 开发者_高级运维sure I'm embedding the right version of the framework (the one modified by install_name_tool
).
What can I do? Thank you in advance.
EDIT: I even tried recompiling the library from sources, specifiying a different install path, but the problem persists. I've tried otool -L
on the executable of my application, and it lists the Ogg framework with the wrong path (/Library/Frameworks/....
). I don't know where it takes it. Please help...
You want to run install_name_tool
on the application's binary.
Or you can change the install name of the framework to @executable_path/../<blah blah>
before you link the application to it.
精彩评论