这是推动我疯了,当我尝试编译在模拟器上,一切正常,但在设备上我得到这个错误: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