Apple Mach O链接器错误

时间:2014-04-06 12:11:30

标签: ios xcode linker-errors

希望你们知道如何解决这个问题。我可能只需要在链接二进制文件中添加一个框架,但我真的找不到要添加的框架。

  

Ld的   /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Products/Debug-iphonesimulator/Sum.app/Sum   正常的i386       cd / Users / Chrismac / Documents / Sum       export IPHONEOS_DEPLOYMENT_TARGET = 7.1       export PATH =“/ Applications / Xcode.app / Contents / Developer / Platforms / iPhoneSimulator.platform / Developer / usr / bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/ usr / bin:/ bin: / usr / sbin目录:/ sbin目录”       /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang   -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk   -L /用户/ Chrismac /库/开发商/ Xcode中/ DerivedData /加总cyzxwtuyfesisgfvermcafpbmtgv /编译/产品/调试,iphonesimulator   -F /用户/ Chrismac /库/开发商/ Xcode中/ DerivedData /加总cyzxwtuyfesisgfvermcafpbmtgv /编译/产品/调试,iphonesimulator   -filelist /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/Sum.LinkFileList   -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min = 7.1 -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker / Users / Chrismac /Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/Sum_dependency_info.dat -o / Users / Chrismac / Library / Developer / Xcode /DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Products/Debug-iphonesimulator/Sum.app/Sum

     

重复符号_PressIt in:       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/SecondViewController.o       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/FirstViewController.o   重复符号_push in:       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/SecondViewController.o       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/FirstViewController.o   重复符号_savedData:       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/SecondViewController.o       /Users/Chrismac/Library/Developer/Xcode/DerivedData/Sum-cyzxwtuyfesisgfvermcafpbmtgv/Build/Intermediates/Sum.build/Debug-iphonesimulator/Sum.build/Objects-normal/i386/FirstViewController.o   ld:架构i386 clang的3个重复符号:错误:链接器   命令失败,退出代码为1(使用-v查看调用)

2 个答案:

答案 0 :(得分:1)

你不是缺少一个lib但你有两个叫做Pressit,Push和SavedData的C函数冲突!

重复的符号位于FirstViewController& SecondViewController。

解决方案:

不要两次实现相同的功能:

  • 如果它们相同,请将它们移至第三个文件并仅包含它们。
  • 如果不同,请重命名。

答案 1 :(得分:0)

我想,您可能已在项目中实施过三次FirstViewController。

在整个项目中搜索FirstViewController,并为项目保留一个FirstViewController。