gpt4 book ai didi

Swift 2/iOS 9 - 找不到 libz.dylib

转载 作者:IT王子 更新时间:2023-10-29 04:59:12 25 4
gpt4 key购买 nike

我在我的新 Swift 2.0 项目中使用了一些来自谷歌的外部代码,这些代码在早期版本中需要“libz.dylib”。更新到新的 Xcode/新的 SDK 之后。

Xcode 现在无法导入 libz.dylib 并抛出一些错误

Undefined symbols for architecture i386: "_deflate", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_deflateEnd", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "deflateInit2", referenced from: +[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_inflate", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "_inflateEnd", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) "inflateInit2", referenced from: +[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

在“构建阶段”设置中查看可用包时,我可以找到“libz.tbd”,它似乎是 libz.dylib 的替代品。导入此库时,链接器错误保持不变,但我收到此附加警告:

warning: skipping file '/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator9.0.sdk/usr/lib/libz.tbd' (unexpected file type 'text' in Frameworks & Libraries build phase)

怎么办?

最佳答案

我遇到了同样的问题。我找到了一些解决方法。

  1. 转到构建阶段 > 将二进制文件与库链接 > + > 添加其他
  2. 在文件选择窗口中执行“CMD”+Shift+G(转到文件夹)并键入/usr/lib/
  3. 您可以从/usr/lib 添加:libz.dylib 等...
  4. 编译并享受乐趣

关于Swift 2/iOS 9 - 找不到 libz.dylib,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30815806/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com