xcode .dylib 文件丢失

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32724799/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:54:41  来源:igfitidea点击:

.dylib file is missing

iosxcodeios9dylib

提问by Jio

I am trying to compile my project in iOS 9. I am using XCode7. Here is how it looks like: error:

我正在尝试在 iOS 9 中编译我的项目。我使用的是 XCode7。这是它的样子:错误:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libz.dylib (No such file or directory)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr/lib/libiconv.dylib (No such file or directory)

My dylib files shows in red color so i tried to add it again but the is no dylib files, all the files are shown in .tbdinstead of .dylib. Please help me on this..

我的 dylib 文件显示为红色,所以我尝试再次添加它,但没有 dylib 文件,所有文件都显示在.tbd而不是.dylib. 请帮我解决这个..

回答by Jio

At last i fixed it. https://forums.developer.apple.com/thread/4572. Add the dylib files into "Other Linker Flags".

最后我修好了https://forums.developer.apple.com/thread/4572。将 dylib 文件添加到“其他链接器标志”中。

enter image description here

在此处输入图片说明

回答by Mike Gledhill

Here's what worked for me.

这对我有用。

  1. Go into your Targets, Build Phases, "Link Binary with libraries", and click on the + button.
  1. 进入您的目标,构建阶段,“将二进制文件与库链接”,然后单击 + 按钮。

enter image description here

在此处输入图片说明

  1. Click on the "Add other..." button
  1. 单击“添加其他...”按钮

enter image description here

在此处输入图片说明

  1. Hit CMD+Shift+G to open the "Go to folder" dialog, and cut'n'paste the folder: /usr/lib
  1. 按 CMD+Shift+G 打开“转到文件夹”对话框,然后剪切'n'粘贴文件夹: /usr/lib

enter image description here

在此处输入图片说明

  1. In the top-right search box, type in a section of your "missing" file, which for me, was libsqlite3.dylib, then click on Open.
  1. 在右上角的搜索框中,输入“丢失”文件的一部分,对我来说是libsqlite3.dylib,然后单击“打开”。

enter image description here

在此处输入图片说明

This should link in the file which was previously missing.

这应该链接到以前丢失的文件中。

(Tested with Xcode 7.1)

(使用 Xcode 7.1 测试)

回答by backslash112

Remove it from "Link Binary with Libraries" fixed my error.

从“Link Binary with Libraries”中删除它修复了我的错误。

回答by Cris

libz.dylib is now found under libz.tbd

现在可以在 libz.tbd 下找到 libz.dylib

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

.tbd 文件是新的“基于文本的存根库”,它提供了一个更紧凑的存根库版本以供在 SDK 中使用

see Swift 2 / iOS 9 - libz.dylib not found

请参阅 Swift 2 / iOS 9 - 未找到 libz.dylib

回答by Bkillnest

I resolved it by:

我通过以下方式解决了它:

Go to Your Target --> Build phases --> Link Binary With Libraries --> Add libiconv.dylib

转到您的目标 --> 构建阶段 --> 将二进制文件与库链接 --> 添加 libiconv.dylib

That's All!

就这样!

回答by Teja Nandamuri

Try to add the libc++..tbd framework to your project. And compile again.enter image description here

尝试将 libc++..tbd 框架添加到您的项目中。并再次编译。在此处输入图片说明

Also try to add libiconv.dylib to your project frameworks.

还可以尝试将 libiconv.dylib 添加到您的项目框架中。