【问题标题】:How do I fix an Apple Mach-O Link Error如何修复 Apple Mach-O 链接错误
【发布时间】:2014-05-11 04:47:10
【问题描述】:

我正在尝试在 Xcode 5 中存档我的 IOS 项目以进行分发,但我收到一条错误消息,提示“Apple Mach-O Link Error and:

Undefined symbols
for architecture arm64: "_OBJC_METACLASS_$_CDVCommandDelegateImpl",
referenced from: _OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o "_CDVLocalNotification",
referenced from: -[AppDelegate application: didReceiveLocalNotification: ] in AppDelegate.o "_OBJC_CLASS_$_CDVCommandDelegateImpl",
referenced from: _OBJC_CLASS_$_MainCommandDelegate in MainViewController.o "_OBJC_CLASS_$_CDVCommandQueue",
referenced from: _OBJC_CLASS_$_MainCommandQueue in MainViewController.o "_OBJC_METACLASS_$_CDVViewController",
referenced from: _OBJC_METACLASS_$_MainViewController in MainViewController.o "_OBJC_CLASS_$_CDVViewController",
referenced from: _OBJC_CLASS_$_MainViewController in MainViewController.o "_OBJC_METACLASS_$_CDVCommandQueue",
referenced from: _OBJC_METACLASS_$_MainCommandQueue in MainViewController.o "_CDVPluginHandleOpenURLNotification",
referenced from: -[AppDelegate application: handleOpenURL: ] in AppDelegate.o
ld: symbol(s) not found
for architecture arm64
clang: error: linker command failed with exit code 1(use - v to see invocation)

简而言之,我该如何解决这个问题?

谢谢

【问题讨论】:

    标签: ios xcode cordova app-store xcode5


    【解决方案1】:

    执行以下步骤

    1. 选择您的项目图标
    2. 选择构建设置。
    3. 对于“架构”,选择 $ARCHS_STANDARD - 标准架构 (armv7, armv7s, arm64)
    4. 对于“有效架构”,添加“arm64”
    5. 选择您的 CordovaLib.xcodeproj 图标
    6. 在项目(不是目标)的构建设置中,删除 条件架构设置(悬停可查看减号)
    7. 对于“架构”,选择 $ARCHS_STANDARD - 标准架构 (armv7, armv7s, arm64)
    8. 对于“有效架构”,添加“arm64”
    9. 转到 6,但现在为“目标”执行此操作

    如果您发现任何问题,请告诉我。

    【讨论】:

    • 如果您同意答案,请投票给答案,这样对其他人也有帮助。
    【解决方案2】:

    对于这种情况有很多相关的答案,这源于 Apple 在 Xcode 5.1 中将 arm64 添加到默认架构中。

    看起来你正在使用cordova,所以我从这里开始:

    xcode 5.1: libCordova.a architecture problems

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-06
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多