使用 XCode 4 在 .app 包中嵌入自定义框架时出现问题
在问这个问题之前,我已经在网络(和SO)上搜索了一段时间。但我完全陷入困境,我不知道如何解决这个问题。
我必须使用 XCode 4 在 .app 包中嵌入自定义框架。我知道我必须使用 install_name_tool
实用程序修复框架的安装路径。我是这样做的:
install_name_tool -change /Library/Frameworks/Ogg.framework/Versions/A/Ogg @executable_path/../Frameworks/Ogg.framework/Versions/A/Ogg <input framework>
我已经通过查看文件的“上次修改”时间戳来验证框架实际上已被处理。
现在的问题:框架被复制到应用程序包中,但是当我运行应用程序时,它崩溃了,并且在错误报告中它告诉 /Library/Frameworks/Ogg.framework/Versions找不到 /A/Ogg
图像。请注意错误的名字。
我确定我嵌入了正确版本的框架(由 install_name_tool
修改的版本)。
我能做些什么?先感谢您。
编辑:我什至尝试从源代码重新编译库,指定不同的安装路径,但问题仍然存在。我在我的应用程序的可执行文件上尝试了 otool -L
,它列出了 Ogg 框架的错误路径 (/Library/Frameworks/....
)。我不知道它会带到哪里。请帮忙...
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...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要在应用程序的二进制文件上运行
install_name_tool
。或者,您可以在将应用程序链接到框架之前将框架的安装名称更改为
@executable_path/../
。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.