Xcode7以后.dylib
的库都找不到了(其实也能找到,后面会介绍),取而代之的则是与其同名的.tbd
库。
这是在stackoverflow搜到的一个满意答案【点击跳转】给出的解释:
For those who are curious, the .tbd files are new "text-based stub libraries", that provide a much more compact version of the stub libraries for use in the SDK, and help to significantly reduce its download size.
大体意思是.tbd
文件是新的“基于文本的存根库”,.tbd
库更小。
所以,删除原有的.dylib
库,在Link Binary With Libraries中添加同名的.tbd
库,Product->Clean后,重新编译就可以了
当然.dylib
库也不是就此消失了。我们可以通过Link Binary With Libraries的+
选择add other添加。

在/usr/lib
文件夹中会找到.dylib
库(我们拿比较常用的libz.dylib
库来举例)

但是可以看到
libz.dylib
库变成了一个类似快捷方式的图标

那就试试选中这个类似快捷方式的
libz.dylib
库点击Open添加进去

发现多了一个
libz.1.dylib
库,而不是libz.dylib
,那么说明libz.1.dylib
就是添加的那个类似快捷方式的实体。重新编译了一下发现编译通过!那么
libz.1.dylib
库就是原始的libz.dylib
库。
- 这些是我目前的理解,欢迎探讨!
关于.dylib替换成.tbd后依然出现错误的相关解决办法:
版权声明:出自MajorLMJ技术博客的原创作品 ,转载时必须注明出处及相应链接!
网友评论