【问题标题】:Apple Mach-O Linker Error - duplicate symbolsApple Mach-O 链接器错误 - 重复符号
【发布时间】:2014-01-16 00:59:19
【问题描述】:

我正在制作的应用程序有点问题。我对此进行了一些研究并查看了其他帖子,但他们提出的修复对我不起作用。我正在运行所有最新的软件。

上面写着:

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

Ld /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Products/Debug-iphonesimulator/People\ 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/Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Products/Debug-iphonesimulator -F/Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Products/Debug-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 /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People\ Bingo.build/Debug-iphonesimulator/People\ Bingo.build/Objects-normal/i386/People\ Bingo_dependency_info.dat -o /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Products/Debug-iphonesimulator/People\ Bingo.app/People\ Bingo

重复符号 _OBJC_IVAR__CollectionViewController._cellArray 在: /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/ViewController.o /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/CollectionViewController.o 重复 符号 _OBJC_CLASS__$_CollectionViewController 在: /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/ViewController.o /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/CollectionViewController.o 重复 符号 _OBJC_METACLASS_$_CollectionViewController 在: /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/ViewController.o /Users/RileyLloyd/Library/Developer/Xcode/DerivedData/People_Bingo-eqtneohyjbwwpxclkkhkbtkcddye/Build/Intermediates/People Bingo.build/Debug-iphonesimulator/People Bingo.build/Objects-normal/i386/CollectionViewController.old: 3 架构 i386 clang 的重复符号:错误:链接器命令 退出代码 1 失败(使用 -v 查看调用)

【问题讨论】:

    标签: c++ ios xcode linker


    【解决方案1】:

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

    您可能有多种方法可以做到这一点:

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

    【讨论】:

    • 我已经很久没有从事这个项目了,因为我无法解决这个问题。我不太记得我想如何编码,但想法是在视图控制器下有一个集合视图控制器作为页面(如原始问题中的图像所示)。我应该怎么做才能解决这个问题?您需要我发布哪些文件?
    • 没关系,我发现了问题。我正在将“CollectionViewController.m”导入“ViewController.m”文件。我注释掉了,现在运行流畅。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-04-06
    • 2023-03-30
    • 1970-01-01
    相关资源
    最近更新 更多