如何针对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)
答案 0 :(得分:1)
您应该始终针对最新的SDK进行编译。如果您需要支持旧设备,则需要更改“部署目标”构建设置,并在真实设备上进行测试(因为Apple不再提供3.x模拟器)。
答案 1 :(得分:0)
看来你的问题更多的是设备/模拟器(i386指的是你的mac中的intel芯片),而不是iOS 3.1.3和iOS 5.0。
答案 2 :(得分:0)
删除并阅读您的框架。
答案 3 :(得分:0)
尝试将构建设置中的MACOSX_DEPLOYMENT_TARGET
更改为10.6
或Compiler Default