When recompiling an existing App in iOS5 sdk you could run to an error in Xcode 4.2 which complains about a missing library:
setenv PATH "/Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer-iOS5/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -arch i386 ..............-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -framework Foundation -framework UIKit -framework CoreGraphics -lsqlite3 -framework CFNetwork -framework SystemConfiguration -framework AudioToolbox -framework OpenGLES -framework QuartzCore -framework CoreFoundation -framework MobileCoreServices -lz.1.2.3 -framework CoreAudio -o /Users...........
ld: library not found for -lz.1.2.3
Command /Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
To fix this issue, navigate to Project Settings -> Build Phases -> Link Binary with libraries,
Browse for libz.1.2.3 dylib which will be displayed in red.
Remove libz.1.2.3.dylib (first select and then use "-" to remove) and then add an entry named libz.1.2.5.dylib
Recompile after cleaning targets.
setenv PATH "/Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer-iOS5/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ -arch i386 ..............-D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -framework Foundation -framework UIKit -framework CoreGraphics -lsqlite3 -framework CFNetwork -framework SystemConfiguration -framework AudioToolbox -framework OpenGLES -framework QuartzCore -framework CoreFoundation -framework MobileCoreServices -lz.1.2.3 -framework CoreAudio -o /Users...........
ld: library not found for -lz.1.2.3
Command /Developer-iOS5/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
To fix this issue, navigate to Project Settings -> Build Phases -> Link Binary with libraries,
Browse for libz.1.2.3 dylib which will be displayed in red.
Remove libz.1.2.3.dylib (first select and then use "-" to remove) and then add an entry named libz.1.2.5.dylib
Recompile after cleaning targets.