简体   繁体   English

Xcode-链接器命令失败,并显示退出代码

[英]Xcode - Linker command failed with exit code

Got a strange issue from Xcode, there aren't code issues and I haven't any idea how to handle with this problem. Xcode出现了一个奇怪的问题,没有代码问题,我也不知道如何处理这个问题。 I also used Google and saw similar questions but the answers weren't useful for me. 我也使用Google并看到了类似的问题,但是答案对我没有用。

duplicate symbol _OBJC_IVAR_$_Level._name in:
..../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build /Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C98F33E28EFA5297.o
/Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C635B4AD47A32079.o
 duplicate symbol _OBJC_IVAR_$_Level._type in:
...../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C98F33E28EFA5297.o
...../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C635B4AD47A32079.o
 duplicate symbol _OBJC_IVAR_$_Level._binaryImage in:
...../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C98F33E28EFA5297.o
..../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C635B4AD47A32079.o
 duplicate symbol _OBJC_CLASS_$_Level in:
..../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C98F33E28EFA5297.o
... ../Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C635B4AD47A32079.o
duplicate symbol _OBJC_METACLASS_$_Level in:
...Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C98F33E28EFA5297.o
......Library/Developer/Xcode/DerivedData/MobileMaps-bfaaljugbcgusoazfkvdbpbdyiqf/Build/Intermediates/MobileMaps.build/Debug-iphonesimulator/MobileMaps.build/Objects-normal/i386/Level-C635B4AD47A32079.o

ld: 5 duplicate symbols for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

From what I've read there are many different reasons for this problem and therefore many different solutions but maybe someone will have done the same stupid thing as me and this will help them. 从我阅读的内容来看,这个问题有很多不同的原因,因此有许多不同的解决方案,但是也许有人会做和我一样愚蠢的事情,这将对他们有所帮助。 I am fairly certain this is not the problem the OP experienced though as my duplicate symbols were in differently named .o files. 我相当确定这不是OP遇到的问题,因为我的重复符号位于不同名称的.o文件中。

Basically be very careful with autocorrect when typing your #import statements. 基本上,输入#import语句时要非常小心自动更正。 I accidentally imported the .m file instead of the proper .h file and ended up with output similar to what the OP has posted. 我不小心导入了.m文件而不是正确的.h文件,并最终得到类似于OP发布的输出。

Hope this helps somebody! 希望这对某人有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM