如何在不收到错误消息“架构i386未定义符号”的情况下编译针对基本SDK“iOS 3.1.3”的iPhone项目?针对iOS 3.1.3编译提供了“未定义的架构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)
我的机器上已经有iOS3模拟器。至少我希望能够在编译时检测到问题(问题在于使用仅在iOS4及更高版本中提供的方法的代码,因此违反了与iOS3的兼容性)。 – forthrin