猿问

Xcode下体系结构x86_64的重复符号

我现在有与上述标题相同的问题,但尚未找到正确的答案。我得到了错误:


    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o

    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)

duplicate symbol _OBJC_METACLASS_$_MoboSDK in:

    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Intermediates/TestMoboSDK-Client.build/Debug-iphonesimulator/TestMoboSDK-Client.build/Objects-normal/x86_64/MoboSDK.o

    /Users/nle/Library/Developer/Xcode/DerivedData/TestMoboSDK-Client-cgodalyxmwqzynaxfbbewrooymnq/Build/Products/Debug-iphonesimulator/libMoboSDK.a(MoboSDK.o)

ld: 75 duplicate symbols for architecture x86_64

clang: error: linker command failed with exit code 1 (use -v to see invocation)

任何帮助表示赞赏。


最后,  我找出了导致我添加-ObjC到中的错误的原因Other Linker Flags。删除此值后,我可以成功构建项目,但是我不知道为什么。谁能解释一下?


慕尼黑5688855
浏览 613回答 4
4回答

慕斯王

对我而言,将“否通用块”从“是”更改为“否”(在“目标”->“构建设置”->“ Apple LLVM-代码生成”下)解决了该问题。

明月笑刀无情

就我而言,我只是创建了一个头文件来定义常量字符串,如下所示:NSString *const AppDescriptionString = @"Healthy is the best way to keep fit";我通过使用static以下方法解决了这种情况:static NSString *const AppDescriptionString = @"Healthy is the best way to keep fit";
随时随地看视频慕课网APP

相关分类

iOS
我要回答