Apple Mach-O链接器错误 - 重复符号

时间:2013-12-28 17:53:48

标签: c++ ios xcode linker

我正在使用我正在制作的应用程序遇到一些麻烦。我研究了一下并查看了其他帖子,但他们提出的修复程序对我不起作用。我正在运行所有最新的软件。

它说:

架构i386的3个重复符号 链接器命令失败,退出代码为1(使用-v查看调用)

  

Ld的   /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/产品/调试-iphonesimulator /人\   Bingo.app/People \ Bingo正常i386       cd“/ Users / RileyLloyd / Documents / Xcode / People Bingo”       setenv IPHONEOS_DEPLOYMENT_TARGET 7.0       setenv 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.0.sdk   -L /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/产品/调试,iphonesimulator   -F /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/产品/调试,iphonesimulator   -filelist / Users / RileyLloyd / Library / Developer / Xcode / DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye / Build / Intermediates / People \   Bingo.build/Debug-iphonesimulator/People \   Bingo.build/Objects-normal/i386/People \ Bingo.LinkFileList -Xlinker   -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min = 7.0 -framework CoreData -framework CoreGraphics -framework UIKit -framework   基础-Xlinker -dependency_info -Xlinker   /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人\   Bingo.build/Debug-iphonesimulator/People \   Bingo.build/Objects-normal/i386/People \ Bingo_dependency_info.dat -o   /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/产品/调试-iphonesimulator /人\   Bingo.app/People \ Bingo

     

重复符号_OBJC_IVAR _ $ _ CollectionViewController._cellArray in:       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/ViewController.o       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/CollectionViewController.o重复   符号_OBJC_CLASS _ $ _ CollectionViewController in:       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/ViewController.o       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/CollectionViewController.o重复   符号_OBJC_METACLASS _ $ _ CollectionViewController in:       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/ViewController.o       /用户/ RileyLloyd /库/开发商/ Xcode中/ DerivedData / People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye /编译/中间体/人   Bingo.build/Debug-iphonesimulator/People   Bingo.build/Objects-normal/i386/CollectionViewController.o ld:3   架构i386 clang的重复符号:错误:链接器命令   退出代码1失败(使用-v查看调用)

enter image description here

1 个答案:

答案 0 :(得分:1)

您的应用中的两个模块(ViewControllerCollectionViewController)提供了类CollectionViewController的实现。三个重复符号是类元数据。

您可以通过多种方式完成此任务:

  • 您有两个模块声明同一个类。也许一个是退化的?
  • @implementation CollectionViewController出现在.hCollectionViewController.m中包含的ViewController.m文件中,或者您在某处包含了.m文件。