I can’t seem to find the answer.
I’ve just used Xcode 4 final version and built an existing project that was built ok 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 choosing the default options.
Do I miss to include a library or framework somewhere?
Could somebody please help. Thank you.
Here’s my solution for Xcode 4.0.2 with SDK 4.3 environment, but I believe it should also work on other setups.
libSystem.B.dylibis not presentunder
/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/usr/lib,however it is present for lower SDK
versions (e.g.
iPhoneOS4.2.sdk)libSystem.B.dylibis just asymbolic link to
libSystem.dylibiPhoneSimulator4.3.sdk/usr/libI’ve applied following command
sudoand my simulatorln -s libSystem.dylib
libSystem.B.dylib
builds started to work again 🙂
NOTE:
libSystem.B.dylibis used by Flurry and Urban Airship so you better don’t delete the reference in project file (of course Urban Airship does not work under Simulator, but I think Flurry does.libSystem.B.dylibmay also be required by other libraries you included to your project.UPDATE: solution still works for iOS5 Simulator after upgrading to Xcode 4.3
UPDATE, March 9th, 2k12: for Xcode installations via App Store, prefix above path with
/Applications/Xcode.app/Contentsor the path where you’ve installed Xcode.app.