本文介绍了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

在构建阶段设置中查看可用包时,可以找到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:

任何想法该怎么办?

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-16 21:35