2011-11-02 50 views
0

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

回答

1

你應該總是對編譯最新的SDK。如果您需要支持較舊的設備,則需要更改「部署目標」構建設置,並在真實設備上進行測試(因爲Apple不再提供3.x模擬器)。

+0

我的機器上已經有iOS3模擬器。至少我希望能夠在編譯時檢測到問題(問題在於使用僅在iOS4及更高版本中提供的方法的代碼,因此違反了與iOS3的兼容性)。 – forthrin

0

看來你的問題更多的是與設備/模擬器(i386是指mac中的intel芯片),而不是iOS 3.1.3 vs iOS 5.0。

0

刪除並閱讀您的框架。

+0

不影響問題 – forthrin

0

嘗試改變構建設置MACOSX_DEPLOYMENT_TARGET10.6Compiler Default

+0

LD:庫找不到-lcrt1.10.6.o
我發現了一個[投稿](http://stackoverflow.com/questions/1365211/error-in-xcode-project- ld-library-not-found-for-lcrt1-10-6-o),但沒有任何建議修復了這個問題。
有人嗎? – forthrin

相關問題