iOS 应用程序同一工作区中多个项目的 xcode 4 静态库链接
正如标题中提到的,我需要一些关于使用静态库的工作工作区的帮助! 这是我的情况:
- App项目;
- 库A
- 库B
依赖:
- App 项目依赖于库A 和库B
- 库A 依赖于库B
- 库B 是原子的
所以...我尝试了很多配置,将B 链接到A,将A 链接到App;或将 B 连接至 A 以及 A & B 到应用程序...但链接器总是出现错误。在第一种情况下,链接器找不到库 B 的符号,在第二种情况下,链接器返回 A 和 B 中符号重复的错误!
有人可以帮助我吗???
As mentioned in title I need some help on working workspace with static libraries!
This is my situation:
- App project;
- Library A
- Library B
The depends:
- App projects depends by Library A and Library B
- Library A depends by Library B
- Library B is atomic
So ... I have tried a lot of configurations, linking B to A, and A to App; or linking B to A and A & B to App ... but always have error from linker. In first case linker cannot find symbols of library B, in second case linker return error of symbol duplicate in A and B!
Someone can help me please???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
静态库不能相互链接。如果库 A 依赖于库 B,那么您所需要做的就是将您的应用程序链接到库 A 和 B。
如果您仍然收到链接器错误,我的猜测是其中一个库添加了 Objective-C 类别,并且您'我们遇到了需要使用 -force_load 解决的众所周知的问题。 查看此答案。
Static libraries can't link with each other. If Library A depends on Library B, all you need to do is to link your App to both libraries A and B.
If you still get a linker error, my guess is that one of the libraries adds an Objective-C category and you've run into the well-known issue that needs to be resolved with -force_load. See this answer.