开发者

Clash facebook-json with existing JSON library in project

开发者 https://www.devze.com 2023-03-30 18:36 出处:网络
I want to use the Facebook authentication in my iphone app. But the problem is that I am already using this json library. https://github.com/stig/json-framework

I want to use the Facebook authentication in my iphone app. But the problem is that I am already using this json library. https://github.com/stig/json-framework

After copying FBConnect to my project, there is a linker error, saying that there is a clash around a class named SBJsonParser.

ld:开发者_高级运维 duplicate symbol _OBJC_METACLASS_$_SBJsonParser in /Users/saileshmittal/Library/Developer/Xcode/.../i386/SBJsonParser-5856452AC92B115F.o for architecture i386

I don't want to change the existing code around the json library that I am using. Is there a work around for this?

I may be looking at the namespacing in importing, something like import "myProject/json.h" and import "facebook/json.h"; how do I go about changing the project structure to support this? Or if there is a better solution, please tell.


Facebook is using the same JSON library, so the easiest thing would probably be to remove one of the two libraries from your project. If you want to keep your own, then just remove Facebook's JSON classes instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消