如何在不收到錯誤消息「架構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