0

How can I compile an iPhone project against Base SDK "iOS 3.1.3" without getting error messages saying "Undefined symbols for architecture i386"?

When using Base SDK "iOS 5.0" everything works fine, but I need to make sure the application works under iOS 3.1.3.

I use XCode 4.2. My frameworks all point to /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)
Rob W
  • 341,306
  • 83
  • 791
  • 678
forthrin
  • 2,709
  • 3
  • 28
  • 50

4 Answers4

1

You should always compile against the latest SDK. If you need to support older devices, you need to change the "Deployment Target" build setting, and test on a real device (since Apple no longer supplies the 3.x simulators).

Mike Weller
  • 45,401
  • 15
  • 131
  • 151
  • I already have the iOS3 simulator on my machine. At least I want to be able to detect problems at compile time (problems being the code using methods only available on iOS4 and later, thus breaking compatability with iOS3). – forthrin Nov 02 '11 at 12:46
0

It seems your problem is more to do with device/simulator (i386 refers to the intel chips in your mac) rather than iOS 3.1.3 vs iOS 5.0.

jbat100
  • 16,757
  • 4
  • 45
  • 70
0

Remove and read your frameworks.

Luke
  • 11,426
  • 43
  • 60
  • 69
Kirby Todd
  • 11,254
  • 3
  • 32
  • 60
0

Try to change MACOSX_DEPLOYMENT_TARGET in build settings to 10.6 or Compiler Default

beryllium
  • 29,669
  • 15
  • 106
  • 125
  • ld: library not found for -lcrt1.10.6.o
    I found a [posting](http://stackoverflow.com/questions/1365211/error-in-xcode-project-ld-library-not-found-for-lcrt1-10-6-o) on this, but none of the suggestions fixed the problem. Anyone?
    – forthrin Nov 02 '11 at 12:39