0

I'm having a duplicate JSON file problem. I have google places SBJSON files and also Facebook JSON files. I see that the typical solution is to remove one of the JSON libraries. When I do this I get many more errors. The Google and FB JSON libraries look very different to me.

ld: duplicate symbol _OBJC_METACLASS_$_SBJsonParser in /Users/myName/Library/Developer/Xcode/DerivedData/GJ-fzuneahndeknibecnhhygyhhvkxl/Build/Intermediates/GJ.build/Debug-iphonesimulator/GJ.build/Objects-normal/i386/SBJsonParser-6AE6A0B799B41343.o and /Users/myName/Library/Developer/Xcode/DerivedData/GJ-fzuneahndeknibecnhhygyhhvkxl/Build/Intermediates/GJ.build/Debug-iphonesimulator/GJ.build/Objects-normal/i386/SBJsonParser-58C4D42EE2A98A37.o for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

enter image description here

hanumanDev
  • 6,592
  • 11
  • 82
  • 146

1 Answers1

0

Well, you've got duplicate files. If the files are the same (i.e., exact duplicates of SBJSONParser, just delete one pair and see if it will build.

mbm29414
  • 11,558
  • 6
  • 56
  • 87
  • that's the problem. removing the FB SBJSONParser just results in many errors: use of undeclared identifiers etc... – hanumanDev May 04 '12 at 15:44
  • What if you remove the other one? Also, are you using different versions of SBJSONParser? If so, is it possible to consolidate the different functionality of the two versions into a single SBJSONParser? **BTW:** I thought when you said **remove one of the JSON libraries** you meant the **entire** library. Sorry if I misunderstood. – mbm29414 May 04 '12 at 15:46
  • If I remove the Google Places SBJSON files I get the same type of errors. FYI - the FB files are not ARC enabled (and have been flagged with -fno-objc-arc) but the Google files are ARC enabled – hanumanDev May 04 '12 at 15:48
  • I'm still unclear, though, whether they represent **exact duplicates** (other than ARC, of course) or not. It seems that they're not the same, which likely means you've got a lot of annoying detail work to do to make one version suitable for all your needs. – mbm29414 May 04 '12 at 15:56
  • the names are the same SBJsonParser, SBJsonWriter etc... but the contents of the files are different. Is there anyway I can just rename one of the to SBJSonParser_FB maybe? – hanumanDev May 04 '12 at 16:01
  • 1
    Sure, but then you need to re-write all of the `import` statements that reference that version. You'll know which ones they are when you do the rename and then try to build! ;-) – mbm29414 May 04 '12 at 16:06