【问题标题】:Compiling for iOS 3.1.3 gives "Undefined symbols for architecture i386"为 iOS 3.1.3 编译会给出“架构 i386 的未定义符号”
【发布时间】:2011-11-02 09:45:44
【问题描述】:

如何针对 Base SDK“iOS 3.1.3”编译 iPhone 项目而不会收到错误消息“架构 i386 的未定义符号”?

使用 Base SDK“iOS 5.0”时一切正常,但我需要确保应用程序在 iOS 3.1.3 下工作。

我使用 XCode 4.2。我的框架都指向 /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/...


BUILD LOG:

Ld "***" normal i386
    cd ***
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang
      -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk
      -L/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
      -F/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
      -filelist "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Intermediates/***.build/Debug-iphonesimulator/***.build/Objects-normal/i386/***.LinkFileList"
      -mmacosx-version-min=10.5
      -Xlinker -objc_abi_version
      -Xlinker 2 -Xlinker -no_implicit_dylibs
      -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -lsqlite3
      -framework Foundation -framework UIKit -framework CoreGraphics
      -o "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator/***.app/***"

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
  "_OBJC_CLASS_$_NSDictionary", referenced from:
  "_OBJC_CLASS_$_NSDecimalNumber", referenced from:
  "_OBJC_CLASS_$_NSMutableCharacterSet", referenced from:
(and 50 more)

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

【问题讨论】:

    标签: iphone xcode


    【解决方案1】:

    您应该始终针对最新的 SDK 进行编译。如果您需要支持旧设备,则需要更改“部署目标”构建设置,并在真实设备上进行测试(因为 Apple 不再提供 3.x 模拟器)。

    【讨论】:

    • 我的机器上已经有了 iOS3 模拟器。至少我希望能够在编译时检测到问题(问题是代码使用仅适用于 iOS4 及更高版本的方法,从而破坏了与 iOS3 的兼容性)。
    【解决方案2】:

    您的问题似乎更多地与设备/模拟器有关(i386 是指您 mac 中的英特尔芯片),而不是 iOS 3.1.3 与 iOS 5.0。

    【讨论】:

      【解决方案3】:

      尝试将构建设置中的MACOSX_DEPLOYMENT_TARGET 更改为10.6Compiler Default

      【讨论】:

      • ld: library not found for -lcrt1.10.6.o
        我在此找到了posting,但没有任何建议可以解决问题。有人吗?跨度>
      【解决方案4】:

      删除并阅读您的框架。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2012-02-09
        • 2012-12-08
        • 1970-01-01
        • 1970-01-01
        • 2011-08-14
        • 1970-01-01
        相关资源
        最近更新 更多