這是推動我瘋了,當我嘗試編譯在模擬器上,一切正常,但在設備上我得到這個錯誤:LD:找不到庫-lz
ld: library not found for -lz
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1
請幫助我瞭解問題的根源:
Ld /Users/ZConsulting/Library/Developer/Xcode/DerivedData/Fontenay-sous-Bois-dhlecgdgtoldsadoctkyueriyius/Build/Products/Debug-iphoneos/Fontenay-sous-Bois.app/Fontenay-sous-Bois normal armv7
cd /Users/ZConsulting/Desktop/Fontenay-sous-Bois
setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -arch armv7 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Users/ZConsulting/Library/Developer/Xcode/DerivedData/Fontenay-sous-Bois-dhlecgdgtoldsadoctkyueriyius/Build/Products
/Debug-iphoneos -F/Users/ZConsulting/Library/Developer/Xcode/DerivedData/Fontenay-sous-Bois-dhlecgdgtoldsadoctkyueriyius/Build/Products/Debug-iphoneos -F/Developer/Platforms/iPhoneOS.platform/Developer/SDKs
/iPhoneOS5.0.sdk/Developer/Library/Frameworks -filelist /Users/ZConsulting/Library/Developer/Xcode/DerivedData/Fontenay-sous-Bois-dhlecgdgtoldsadoctkyueriyius/Build/Intermediates/Fontenay-sous-Bois.build/Debug-iphoneos/Fontenay-sous-Bois.build/Objects-normal/armv7/Fontenay-sous-Bois.LinkFileList -dead_strip -fobjc-arc -miphoneos-version-min=5.0 -framework SenTestingKit -lz -lz.1.1.3 -framework MobileCoreServices
-framework SystemConfiguration -framework CFNetwork -framework CoreLocation -framework MapKit -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ZConsulting/Library/Developer/Xcode/DerivedData/Fontenay-sous-Bois-dhlecgdgtoldsadoctkyueriyius/Build/Products/Debug-iphoneos/Fontenay-sous-Bois.app/Fontenay-sous-Bois
編輯:
我做進口libz.1.1.3.dylib框架:
我在鏈接的框架得到的唯一libz進行的是libz.1.1.3.dylib
我已導入libz.1.1.3.dylib庫,請把我的編輯一看,這正與我同模擬器編譯,但由於我試圖建立一個檔案,我明白了。 – Luca 2012-03-21 11:49:36
是的,模擬器使用與設備不同的位置。你最好導入通用的'libz.dylib'而不是特定的'libz.1.1.3'。嘗試'find/Developer/Platforms -name libz.1.1.3.dylib'並檢查它是否在'iPhoneOS5.0中找到。sdk' *和*'iPhoneSimulator5.0.sdk'。如果找不到,那麼我建議用'libz.dylib'替換它。你應該有一個令人信服的理由使用'1.1.3'版本的libz來引用這個特定的版本(通常這些庫是向上兼容的) – Petesh 2012-03-21 11:59:14
我在列表中唯一得到的libz框架是'libz.1.1。 3.dylib',請看看我的更新。 – Luca 2012-03-21 13:03:47