How can I build in Xcode 4 for the purpose of deploying iOS 3.1 using libSystem.B?

I recently upgraded from Xcode 3 to 4, and now I'm having problems creating my iPhone project. I need to support older versions of iOS up to 3.1. With Xcode 3.2.5, I had no problem with SDK 4.2 using the deployment target of iOS 3.1. I also included a weak link to the libSystem.B library, which is required to run the application on older versions of iOS. Now when I build with Xcode 4, I get a linker error below. The compilation step completes, but the link step fails. If I remove the weak link to the libSystem.B library, then the assembly is completed, but the application starts when it starts when running on iOS 3.1.

Has anyone found a solution to this problem? How do you create with Xcode 4 to run on the old version of iOS?

ld: library not found for -lSystem.B collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

+5
source share
4 answers

In the project build settings in the "Other linker flags" section, add the following:

-weak_library / usr / lib / libSystem.B.dylib

It should be automatically added to the settings of your target assembly, but if it is not, you should add it there.

+6
source

OK, the weak_library option is the right track ... here are the problems:

.B . , Obj-C (, Blocks) , API , .B. , libSystem.B, ( ).

: .

, libSystem.B. , , . , - . . Apple ... , .

, 5.1- SDK libSystem.B.dylib, ... , , , , t die on build.

, , , . , ... , .

/usr/lib/libSystem.B - , OSX, iOS. , DEVICE , , Intel.

libSystem.B SDK , , , , , Apple (, 5.1 ), , .

, , , , :

  • libSystem.B.dylib ( -link -weak_library, ).
  • libSystem.dylib iOS SIMULATOR libSystem.B.

, .B , ios5.x , , .B - . XCode 4.4 ( 2012) :

cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/usr/lib
sudo ln -s libSystem.dylib libSystem.B.dylib

, , -, , , , ios 5.x, B... ... , , , , .

:

+4

Xcode 4.0.2 SDK 4.3, , .

  • libSystem.B.dylib /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib SDK (, iPhoneOS4.2.sdk)
  • libSystem.B.dylib - libSystem.dylib
  • iPhoneSimulator4.3.sdk/usr/lib sudo ln -s libSystem.dylib libSystem.B.dylib :)

: libSystem.B.dylib Flurry Urban Airship, (, Urban Airship Simulator, , Flurry. libSystem.B.dylib , .

+3

:

  • libSystem.B.dylib MAC (/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.2.sdk/usr/lib/libSystem.B.dylib).!!! xCode 3.2.5 MAC 4.0 4.2 SDK.!!!
  • Go to: ProjectSettings> Goals> BuildPhases> Link the binaries to the libraries> '+'.
  • 'Add another'. Select the copied libSystem.B.dylib file (you can find it in your project package)
  • Build ...

After that, I did not get a "library not found for the -lSystem.B error."

The application also launches the file on devices with iOS <4.

This is very strange, but it seems that the problem is inside the libSystem.B.dylib embedded file. Native - I mean xCode 4.0.2.

Good luck.

0
source

All Articles