Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

6 duplicate symbols for architecture i386

duplicate symbol _OBJC_METACLASS_$_SBJsonParser in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonParser.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonParser.o)
duplicate symbol _OBJC_CLASS_$_SBJsonParser in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonParser.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonParser.o)
duplicate symbol _OBJC_IVAR_$_SBJsonWriter.sortKeys in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonWriter.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonWriter.o)
duplicate symbol _OBJC_IVAR_$_SBJsonWriter.humanReadable in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonWriter.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonWriter.o)
duplicate symbol _OBJC_METACLASS_$_SBJsonWriter in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonWriter.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonWriter.o)
duplicate symbol _OBJC_CLASS_$_SBJsonWriter in:
    /Users/Gaditek/Library/Developer/Xcode/DerivedData/DietBet-gyhoyhmdrobtqregldjyixtgmize/Build/Intermediates/DietBet.build/Debug-iphonesimulator/DietBet.build/Objects-normal/i386/SBJsonWriter.o
    /Users/Gaditek/Desktop/AliMaisamProjects/Dietbet/DietBet/libfacebook_ios_sdk.a(SBJsonWriter.o)
ld: 6 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Please tell me how to fix this issue?

like image 260
Ali Maisam Avatar asked Mar 20 '13 10:03

Ali Maisam


People also ask

What does 1 duplicate Symbol for architecture x86_ 64 mean?

Well, it means we're trying to link the same symbol name (in our case, a method) from two (or more) different source files. The fix was easy: rename one of the methods by updating the header file, the source file (. c or .

What is duplicate symbol error?

Duplicate symbols occur when you have both added an implementation file (. cpp) to your project and #included it. This way, the implementation file (. cpp) gets compiled twice: once as a module in your project (as it is added to your project) and subsequently as a piece of #included code.


3 Answers

As you can see the linker complains that SBJsonWriter and SBJsonParser are both defined in libfacebook_ios_sdk.a and as individual files in your project.

You cannot really solve the problem except removing the individual files from your target.

The problem is that the developers of libfacebook_ios_sdk.a thought it would be a good idea to use the json framework (not caring for clashes with code used in the host app). This is a common problem with SDKs on iOS.

like image 126
Nikolai Ruhe Avatar answered Sep 22 '22 22:09

Nikolai Ruhe


I had resolved issues please follow step.

  1. Goto application's target
  2. Compile Sources
  3. Remove duplicate file using (-).enter image description here
like image 36
Piyush Avatar answered Sep 22 '22 22:09

Piyush


The problem is most likely due to a typo when including the header. Check so that the header file (.h) is included and not the implementation file (.m).

This was the issue for me

like image 45
joacar Avatar answered Sep 25 '22 22:09

joacar