Duplicate Symbol XCode duplicate library for same library?
Do you have any idea? Why XCode compilation give this result?
ld: duplicate symbol _kJSONDeserializerErrorDomain in
/Users/Shared/_BUILDS_/Debug-iphoneos/libLACDLibrary.a(CJSONDeserializer.o)
and /Users/Shared/_BUILDS_/Debug-iphoneos/开发者_如何学ClibLACDLibrary.a(CJSONDeserializer.o)
I have exactly the same problem. And it only complains for arm6 build (not arm7 build). I found a workaround: remove "-all_load" in Other linker flag under Build<-Get Info<-Target. I am not sure whether it is a correct workaround. I hope somebody can explain further and provide the correct workaround if this one is not.
This error occurs if you link the same library into your project multiple times.
Project dependencies are subtly different from linking the libraries together. It is okay to have several projects depend on the same shared library project X; however, make sure that only one of the projects actually links the library.
Hey, you probably have a duplicate reference in XCode to CJSONDeserializer, so it's compiled and linked twice.
I hit this issue with code like the following in a file called Common.h
:
void dumpViews(UIView* view, NSString *text, NSString *indent) {
// ...
}
By adding static in front of the method definition it cleared the problem up for me:
static void dumpViews(UIView* view, NSString *text, NSString *indent) {
// ...
}
精彩评论