2011-11-02 52 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

相关问题