1
votes

Hello I am trying to install json framework. According to installation instructions I have to copy all the classes from json-framwork/classes in my project! I did that and I am getting this error:

ld: duplicate symbol _OBJC_METACLASS_$_SBJsonParser in /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-4254E5B76E32172.o and /Users/user/Library/Developer/Xcode/DerivedData/testhttp-eavsbuatbfoagsgbqfnevfpjxxfc/Build/Intermediates/testhttp.build/Debug-iphonesimulator/testhttp.build/Objects-normal/i386/SBJsonParser-46310C881BFA9776.o for architecture i386 collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

What I am doing wrong here?

2

2 Answers

5
votes

Please have a look at:

iPhone: Duplicate Symbol Error?

Select the project navigator in the right sidebar. Double click your project(top element).

Now open the build phases tab. There is a section which is called Compile Sources. Open it an check if there is a duplice entry of the file which the error refers to.

My Installation of the json-framework

Just added these files to my project

enter image description here

Each .m file is here only once

enter image description here

In the class I need JSON parsing I'll just import:

#import "JSON.h"
0
votes

I just erase the .m and .h files from JSON Framework wich the compilator was giving me errors, at the end I just keep from the JSON Framework: NSObject+SBJSON, NSSTring+SBJSON .h and m. This worked for me, I hope it helps :D