Swift 2 / iOS 9 - 找不到libz.dylib [英] Swift 2 / iOS 9 - libz.dylib not found

查看:118
本文介绍了Swift 2 / iOS 9 - 找不到libz.dylib的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm using some external codes from google in my new Swift 2.0 project that required "libz.dylib" in earlier versions. After updating to the new XCode / the new SDK.

XCode现在无法导入libz.dylib并引发一些错误

XCode is now unable to import the libz.dylib and throws some errors


架构i386的未定义符号:
_deflate,引用自:
+ libGoogleAnalyticsServices.a中的[GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode: GAICompressionUtil.o)
_deflateEnd,引用自:
+ [GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
deflateInit2 ,引用自:
+ [GAICompressionUtil gai_dataByCompressingBytes:length:compressionLevel:mode:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
_inflate,引用自:
+ [ GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:] in libGoogleAnalyticsServices.a(GAICompressionUtil.o)
_inflateEnd,引用自:
(GAICompressionUtil.o)
inflateInit2 中的[GAICompressionUtil gai_dataByInflatingBytes:length:isRawData:],引用自:
+ [GAICompressionUtil gai_dataByInflatingBytes:length:isRawData: ]在libGoogleAnalyticsServices.a(GAICompressionUtil.o)中
ld:找不到体系结构i386的符号
clang:错误:链接器命令失败,退出代码1(使用-v查看调用) p>

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。在导入这个库时,链接器错误保持不变,但我得到了这个额外的警告:

When looking through the available packages in the "build phase" settings I can find "libz.tbd" which seems to be the replacement for the libz.dylib. When importing this lib the linker error stays the same but I get this additional warning:


警告:跳过文件'/ Applications / Xcode-beta .app / Contents / Developer / Platforms / iPhoneSimulator.platform / Developer / SDKs / iPhoneSimulator9.0.sdk / usr / lib / libz.tbd'(Frameworks& Libraries构建阶段中的意外文件类型'文本')

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)

任何想法该怎么办?

Any idea what to do?

推荐答案

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

I had the same problem. I found some kind of way around.


  1. 转到生成阶段>链接二进制文件> +>添加其他

  2. 在文件选择窗口中执行CMD+ Shift + G(转到文件夹)并键入/ usr / lib /

  3. 从/ usr / lib中,您可以添加:libz.dylib等等...

  4. 编译并玩得开心

  1. Go to Build Phases >Link Binary with Librairies > + > Add other
  2. Once in the file selection window do "CMD"+Shift+G (Go to folder) and type /usr/lib/
  3. From /usr/lib you can add : libz.dylib and more...
  4. Compile and have fun

这篇关于Swift 2 / iOS 9 - 找不到libz.dylib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆