Reputation: 117
Just replaced my XCode 4.0.1 with 4.2. Trying to run the iPhone game project I’m currently working on, faced the error:
ld: library not found for -lz.1.2.3 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang++ failed with exit code 1
The full text:
Ld "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator/Hit The Road.app/Hit The Road" normal i386
cd "/MyProjects/Hit The Road"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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/iPhoneSimulator5.0.sdk -L/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator -F/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator -filelist "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Intermediates/HitTheRoad.build/Debug-iphonesimulator/Drive.build/Objects-normal/i386/Hit The Road.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz -ObjC -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -lz.1.2.3 -weak_framework MapKit -framework CoreLocation -weak_framework GameKit -framework AddressBookUI -framework AddressBook -framework CFNetwork -framework MobileCoreServices -lsqlite3.0 -framework SystemConfiguration -framework Security -framework QuartzCore -weak_framework UIKit -framework OpenGLES -framework OpenAL -framework AudioToolbox -framework AVFoundation -weak_framework Foundation -framework CoreGraphics -o "/Users/sergiibondar/Library/Developer/Xcode/DerivedData/HitTheRoad-ccehewjarqhrkacsekxxcuewglcx/Build/Products/Debug-iphonesimulator/Hit The Road.app/Hit The Road"
Trying to figure out what’s wrong, found out that it could be about the Mac OS X Deployment Target. So I’ve tried to set it to 10.4 10.5 and 10.6. Unfortunately it didn’t help.
I’m working on MacOS 10.6.8
Did anybody get such errors before? Maybe someone know at least what this error is about?
Upvotes: 0
Views: 1819
Reputation: 7719
Click the Project in the File Navigator, then select the Target. Scroll down to Linked Frameworks and Libraries and find the libz library being used and remove it, the name may be colored red. Next, click "+" and type libz and add a version 1.2.3 or newer. Often, simply selecting libz.dylib will work. Finally, clean and rebuild.
Upvotes: 3