如何向iPhone项目添加第三方框架? [英] How do I add a third party Framework to iPhone project?

查看:223
本文介绍了如何向iPhone项目添加第三方框架?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的iPhone应用程序中使用PLDatabase框架。我已经添加框架到我的Xcode项目。但是,当我运行我的应用程序,它崩溃与以下错误:

I am trying to use the PLDatabase framework in my iPhone app. I've added the framework to my Xcode project. However, when I run my app, it crashes with the following error:

dyld: Library not loaded: @loader_path/../Frameworks/PlausibleDatabase.framework/Versions/A/PlausibleDatabase
  Referenced from: /Users/todd/Library/Application Support/iPhone Simulator/User/Applications/BB3C66B2-A5BB-4329-B163-AB0072411AF1/Congress.app/Congress
  Reason: image not found

我不确定框架需要什么

感谢

推荐答案

不支持嵌入式框架的动态链接。虽然你可能能够使模拟器工作,但它不会在设备上工作。如果你想使用代码,你必须为框架(libpldatabase.a)构建静态库,然后将它们链接到应用程序。

iPhone does not support dynamic linking of embedded frameworks. While you might be able to finagle the simulator to work, it will not work on the device. If you want to use the code you must build the static library for the framework (libpldatabase.a), and then link them to the app.

Xcode GUI不为静态链接提供一个很好的接口,你将需要在你的构建prefs(-lpldatabase -L / whatever / dir / it / is / in)中添加适当的标志。

The Xcode GUI does not provide a nice interface for static linking, you will need to add appropriate flags in your build prefs (-lpldatabase -L/whatever/dir/it/is/in).

这篇关于如何向iPhone项目添加第三方框架?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆