Friday 1 March 2013

How to fix "ld: duplicate symbol _OBJC_METACLASS_$_XXX..." during the compile?

I got this error message when compiling my code.

"ld: duplicate symbol _OBJC_METACLASS_$_Baby in /Users/Jerry/Documents/Code/iPhone/NewVideo/Baby/build/Baby.build/Debug-iphonesimulator/Baby.build/Objects-normal/i386/Baby-C3CF279EAEDF8D27.o and /Users/Jerry/Documents/Code/iPhone/NewVideo/Baby/build/Baby.build/Debug-iphonesimulator/Baby.build/Objects-normal/i386/Baby-340A0D8EE2B8BC3A.o"

Basically, I accidentally import the same file twice(Baby.h & Baby.m) in my project. After removing the old files, the compile went through successfully. So just simply check if the same file gets included in your project more than once in different hierarchy(maybe under different groups or folders).

No comments:

Post a Comment