Duplicate Symbol Error

后端 未结 11 1989
情书的邮戳
情书的邮戳 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: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.

提交回复
热议问题