objective-c – ld:找不到-lz的库

objective-c – ld:找不到-lz的库,第1张

概述这让我发疯,当我尝试在模拟器上编译时,一切都很好,但在设备上我得到了这个错误: ld: library not found for -lzCommand /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1 请帮我理解问题的根源: Ld /Users/ZConsulting/L 这让我发疯,当我尝试在模拟器上编译时,一切都很好,但在设备上我得到了这个错误:
ld: library not found for -lzCommand /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框架:

我在linked框架中获得的唯一libz是libz.1.1.3.dylib

解决方法 您确实在linked frameworks和librarIEs项中指定了库libz.dylib,而不是直接引用libz.1.1.3 – 通常您应该使用库的最通用版本进行编译而不是更具体的库

其次,确保libz.dylib存在于iOS SDK下 – 如果缺少,则可能是错误安装的SDK(重新安装应该修复).

find /Developer/Platforms -name libz.dylib

应该导致iPhoneOS5.0.sdk下libz.dylib的非空输出

另请参阅iPhone – Linker Error in Xcode 4.2 Preview的答案,这与此类似.

总结

以上是内存溢出为你收集整理的objective-c – ld:找不到-lz的库全部内容,希望文章能够帮你解决objective-c – ld:找不到-lz的库所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/langs/1258666.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-07
下一篇2022-06-07

发表评论

登录后才能评论

评论列表(0条)

    保存