Duplicate Symbols for Architecture arm64

前端 未结 24 2701
礼貌的吻别
礼貌的吻别 2020-12-02 16:21

When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck:

24条回答
  •  醉话见心
    2020-12-02 16:43

    This error happens when Linker is trying to link the obj files. Few reasons that i could think of for this error are:

    1. The duplicated Function/Class is defined at two different places/files in the project and only one of them was supposed to compile for any variation of build command. But somehow both those files got compiled in your project. So you need to check your if-else conditions or other dependencies which adds src files to the list of files needed to be compiled and remove the un-needed file for your particular build command.

    2. The duplicated Function/Class is defined accidentally at two different places/files in the project. Remove the wrong definition.

    3. Clean your OBJ directory before you build again, there could be some old obj files in there from your previous builds which might be causing this conflict.

    P.S i am no expert, but this is how i solved this problem when i faced it. :)

提交回复
热议问题