架构arm64的112个重复符号

时间:2016-11-18 06:13:47

标签: ios linker-errors duplicate-symbol

duplicate symbol _OBJC_METACLASS_$_GTMOAuth2Keychain in:
    /Users/anand/Library/Developer/Xcode/DerivedData/NIDA_Rooms-bawdeawpyzqrkjazbcspzbsqgrht/Build/Products/Release-iphoneos/GTMOAuth2/libGTMOAuth2.a(GTMOAuth2ViewControllerTouch.o)
    /Users/anand/Documents/Anand_ios_Project/ROC&NIDAROOMS/ROCAPP 3/GoogleOpenSource.framework/GoogleOpenSource(GTMOAuth2ViewControllerTouch.o)
ld: 112 duplicate symbols for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

2 个答案:

答案 0 :(得分:1)

You link against GoogleOpenSource.framework and libGTMOAuth2.a. Both contain (define) the symbol _OBJC_METACLASS_$_GTMOAuth2Keychain. You should remove either the framework or the lib from linking.

答案 1 :(得分:0)

implementation文件中定义.h时可能会发生这种情况。

尤其是在这种情况下,请查看GTMOAuth2Keychain的定义位置以及是否在GTMOAuth2ViewControllerTouch.h中。

通过将实现移至.mm/.m文件来解决此问题。