Clash facebook-json with existing JSON library in project

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

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

ld: duplicate character _OBJC_METACLASS _ $ _ SBJsonParser in /Users/saileshmittal/Library/Developer/Xcode/.../i386/SBJsonParser-5856452AC92B115F.o for i386 architecture

I do not want to change the existing code around the json library that I am using. Is there any work for this?

I can look at the namespace when importing, something like import "myProject/json.h" and import "facebook/json.h" ; How can I change the structure of the project to support this? Or, if there is a better solution, let me know.

+4
source share
1 answer

Facebook uses the same JSON library, so the easiest way would be to remove one of the two libraries from your project. If you want to keep your own, then just remove the Facebook JSON classes.

+3
source

Source: https://habr.com/ru/post/1369126/


All Articles