类与静态库之间的冲突 [英] Conflict between class and static library

查看:143
本文介绍了类与静态库之间的冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中使用Layar Player。

它提供了一个静态库以包含在您的项目中。

安装并尝试编译后,出现此错误:

I'm using Layar Player in my app.
It provides a static library to include in your project.
After installing and trying to compile, I got this error:


ld:
中的重复符号_OBJC_CLASS _ $ _ Reachability / / LayarPlayer / Debug / liblayarplayer.a(Reachability.o)​​和
/
/MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/Reachability.o
用于体系结构armv7

ld: duplicate symbol _OBJC_CLASS_$_Reachability in //LayarPlayer/Debug/liblayarplayer.a(Reachability.o) and //MyApp.build/Debug-iphoneos/MyApp.build/Objects-normal/armv7/Reachability.o for architecture armv7

我在我的应用程序中使用了可达性来检查网络状态,但是好像它已经包含在库中了.br

我尝试删除代码中的所有 #import可达性,但是很明显我收到未声明的函数错误。

如何解决此问题?

I'm using Reachability in my app to check network status, but it seems like it's already included in the library.
I've tried removing every #import Reachability in my code, but obviously I get "undeclared function" errors.
How can I solve this?

推荐答案

我从目标中排除了所有有冲突的.m文件,现在一切都很好。

标头文件不能删除。

I excluded all conflicting .m files from the target and everything is fine now.
Headers files must not be deleted.

这篇关于类与静态库之间的冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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