苹果Mach-O错误Xcode-真的很困惑



我正致力于在我的iOS应用程序中实现Kiip.me框架。我已经添加了框架和所有内容并将其链接,但当我运行它时,我在Apple Mach-O中遇到了大量错误。我还收到了一个警告,因为我很久以前从谷歌分析中删除了一个文件,即使在我删除了所有引用之后,它仍在寻找这个文件。这是错误代码,我的主要问题是错误说:

 Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Kiip", referenced from:
  objc-class-ref in AppDelegate.o
  objc-class-ref in CircleTableViewController.o

&

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

但这是完整的错误代码:

Ld/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreator dbjnngeqphrtevdurkdpgggxapny/Build/Products/Debug iphonesimulator/CirleCreatetor.app/CircleCreator normal x86_64cd"/Users/Coconido/Documents/Circle Creator/Circle创建者"setenv IPHONEOS_DEPLOYMENT_TARGET 6.0setenv PATH"/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.Platforms/Developer//usr/bin:/Applications/Xcode/app/Contents/Developer/usr/bin:/usr/bin:/usr/sbin:/sbin"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang-arch x86_64-isysroot/Applications/Xcode/app/Contents/Developer/Platforms/iPhoneSimulator.platform/DDeveloper/SDKs/iPhoneSimulator 7.0.sdk-L/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreator dbjnngeqphrtevdurkdpgggxapny/Build/Products/Debug iPhoneSimulator-L/Users/Coconido/Documents/Cirle\Creator/CirleCreator/GoogleAnalyticsServicesOS_3.02/谷歌分析/库-L/Users/Coconido/DocumentsCircle\Creator/CircleCreator/Images/openkit-ios.1.0.2/OpenKitSDK-F/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreater dbjnngeqphrtevdurkdpgggxapny/Build/Products/Debug iphonesimulator-F/Users/可可Creator/CirleCreator/Images/openkit-ios.1.0.2/OpenKitSDK/Vendor-F/Applications/Xcode.app/Contents/Developer/Library/Frameworks-F/Users/Coconido/Documents/Cirle\Creator/CircleCreator/CycleCreator/Kiip-ios-SDK-v2-F/Users/Coconido/Documents Circle\Creator/CirleCreater/Kiip-ios-SDK-v2-F/Users/Coconido/Documents/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreator dbjnngeqphrtevdurkdpgggxapny/Build/Intermediates/CirleCreatetor.Build/Debug-iphoneimulator/CirleCreatitor.Build/Objects-normal/x86_64/CircleCreator.LinkFileList-Xlinker-objc_abi_version-Xlinker2-fobjc arc-fobj链接运行时-Xlinker-no_inimplicit_dylibs-mios模拟器版本min=6.0-framework CoreLocation-framework KiipSDK-framework PassKit-framework AdSupport-framework CoreTelephony-framework SystemConfiguration-framework MobileCoreServices-framework Social-framework Accounts-framework QuartzCore-framework Security-lsqlite3-framework StoreKit-frameworkCoreData-lz-framework MessageUI-framework iAd-framework AVFoundation-framework Core Graphics-frameworkUIKit-frameworks Foundation-Xlinker-dependency_info-Xlinker/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreator dbjnngeqphrtevdurkdpgggxapny/Build/Inmediates/CirleCreatetor.Build/Debug-iphoneimulator/Cirlecreator.Build/Objects-normal/x86_64/CircleCreator_dependency_info.dat-o/Users/Coconido/Library/Developer/Xcode/DerivedData/CirleCreator dbjnngeqphrtevdurkdpgggxapny/Build/Products/Debug-iphoneimulator/CirleCreatetor.app/CircleCreator

ld:警告:未找到选项"-L/Users/Coconido/Documents/Circle Creator/Circle Creater/GoogleAnalyticsServicesiOS_3.02/GoogleAnalytics/Library"的目录ld:警告:未找到选项"-F/Users/Coconido/Documents/Circle Creator/Circle Creater/CircleCreator/Kip-iOS-SDK-v2"的目录ld:警告:未找到选项"-F/Users/Coconido/Documents/Circle Creator/Circle Creater/Kiip-iOS-SDK-v2"的目录ld:警告:忽略文件/Users/Coconido/Documents/Circle Creator/Circle Creater/KiipSDK.framework/KiipSDK,在文件/Users/Coconido/Documents/Cirle Creator/CcileCreator/KiipSDK中缺少所需的体系结构x86_64(3个切片)体系结构x86_64的未定义符号:"_OBJC_CLASS_$_Kiip",引用自:AppDelegate.o中的objc类引用CircleTableViewController.o中的objc类引用ld:找不到体系结构x86_64的符号clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

您的项目仍在引用GoogleAnalytics的库(很可能在构建阶段->将二进制与库链接)。这是第一个错误(实际上只是一个警告)。

您正在处理的第二个错误是所包含的框架Kiip。它没有64位版本的框架,所以如果你的项目构建设置允许构建64位应用程序,它将不会编译,因为你引用了Kiip,无法使用它。

三个解决方案:

  1. 从项目中删除Kiip
  2. 了解如何构建64位Kiip框架
  3. 使您的项目不构建64位体系结构。(构建设置->有效架构)

Undefined symbols for architecture错误是链接器在找不到要链接的对象文件时抛出的。你提到你已经链接了框架——我会仔细检查你是否已经正确链接了框架。(在Xcode中,您可以在项目的文件>Build Phases>Link Binary with Libraries下找到链接的二进制文件列表。)

如果所有链接器标志都设置正确,并且在干净的构建后问题仍然存在,则Kiip.me框架可能不包含x86_64(即iPhone模拟器)的代码。

最新更新