Duplicate Symbol Error

后端 未结 11 1877
情书的邮戳
情书的邮戳 2021-01-18 03:44

I\'m not sure what I did but I added an IBOutlet to display an additional attribute in a TableView cell. When building the application I get the following error message...

相关标签:
11条回答
  • 2021-01-18 04:07

    If more than one class shares a same name this kind of error will come

    0 讨论(0)
  • 2021-01-18 04:16

    Other than the .m issue, if you created models in the wrong folder, deleted them and then created/replaced the models in the correct folder. You may need to remove the duplicates in Targets Build Phases under the Compiled Sources grouping.

    0 讨论(0)
  • 2021-01-18 04:22

    I had a similar issue:

    ld: duplicate symbol _OBJC_METACLASS_$_MyClass1 in /Users/.../MyClass2.o and /Users/.../MyClass1.o for architecture armv7
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    

    And finally the reason was that inside MyClass2.m I wrote:

    #include "MyClass1.m"
    

    Instead of

    #include "MyClass1.h"
    

    It's hard to find when you have a lot of #include statements inside your .m file.

    0 讨论(0)
  • 2021-01-18 04:22

    I dont really understand why this would be a problem so maybe someone could clarify but for me the problem was that I had imported another class which had declared an instance variable with the same name as one in the current class.

    When I changed the name of the ivar in the imported class's implementation the error disappeared.

    Hope this helps!

    0 讨论(0)
  • 2021-01-18 04:26

    This might b due to the reason that you have included two source files of Inspection class

    0 讨论(0)
提交回复
热议问题