Xcode 4 error (final version) when creating

I can not find the answer.

I just used the final version of Xcode 4 and built an existing project that was built in order with Xcode 3, but got this error:

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

But another project was built OK with Xcode 4.

I installed Xcode 4 by selecting the default options.

Can't I include a library or framework somewhere?

Can someone please help. Thanks.

+6
xcode4
source share
5 answers

Here is my solution for Xcode 4.0.2 with SDK 4.3, but I believe that it should work with other settings as well.

  • libSystem.B.dylib not under /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib however it is present for a lower SDK version (e.g. iPhoneOS4.2.sdk )
  • most cases of libSystem.B.dylib is just a symbolic link to libSystem.dylib
  • so in iPhoneSimulator4.3.sdk/usr/lib I applied the following command sudo ln -s libSystem.dylib libSystem.B.dylib and my build simulator started working again :)

NOTE: libSystem.B.dylib used by Flurry and Urban Airship, so you better not remove the link in the project file (of course, Urban Airship does not work under Simulator, but I think that other libraries may also need Flurry. libSystem.B.dylib , included in your project.

UPDATE: solution still works for iOS5 Simulator after upgrading to Xcode 4.3

UPDATE, March 9, 2k12: to install Xcode through the App Store, prefix the path above with /Applications/Xcode.app/Contents or the path where you installed Xcode.app.

+14
source share

solved.

It turns out that in my project there was a link to libSystemB (I don't know why this is there). After removing the link, it was well built.

Thanks to everyone guys!

+1
source share

-weak_library /usr/lib/libSystem.B.dylib crashes iOS Simulator. Use -weak-lSystem .

The quote belongs to gparker in official developer forums.

+1
source share

-weak_library / usr / lib / libSystem.B.dylib breaks the iOS simulator. Use -weak-lSystem instead.

nicktmro got it right, especially when you are developing cocos2d projects using xcode 4.x

+1
source share

I have the same problem since then, and I always made a symbolic link, as described here, every time I updated xCode. Today I found a new way to fix this:

For your purposes, the Complex phases go to "Link Binary With Libraries" and search for: libz.dylib

Set the Required value to Optional

BUILD

BE HAPPY

0
source share

All Articles