Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

1 duplicate symbol for architecture i386

I am facing a critical problem here, Xcode throws strange exception while building it's "

duplicate symbol _selected in: /Users/mhgaber/Library/Developer/Xcode/DerivedData/اProject-Name-aopcbghvorqhdwbyudzqsyhtekcu/Build/Intermediates/Project-Name.build/Debug-iphonesimulator/Project-Name.build/Objects-normal/i386/ClassX.o /Users/mhgaber/Library/Developer/Xcode/DerivedData/Project-Name-aopcbghvorqhdwbyudzqsyhtekcu/Build/Intermediates/Project-Name.build/Debug-iphonesimulator/Project-Name.build/Objects-normal/i386/ClassY.o ld: 1 duplicate symbol for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I searched a lot but I didn't find anything help me please

like image 887
user2768121 Avatar asked Sep 18 '13 23:09

user2768121


People also ask

What does 1 duplicate symbol for architecture x86_64 mean?

This answer is not useful. Show activity on this post. 75 duplicate symbols for architecture x86_64. Means that you have loaded same functions twice.

What is a duplicate symbol?

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.


1 Answers

Look at both the files for ClassX and ClassY - What targets are they included in? Basically the _selected method is duplicated in both of them. I am going to guess this is a plain C method that happens to be named the same in both files. Try renaming _selected in one of the files.

like image 86
dtrotzjr Avatar answered Oct 04 '22 02:10

dtrotzjr