用于 iOS 9 的 xcode 7.1 缺少目标 C 领域静态框架所需的 libc++.dylib

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/32914064/
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:59:40  来源:igfitidea点击:

xcode 7.1 for iOS 9 missing libc++.dylib required for Objective C Realm Static Framework

iosobjective-cxcodeios9ios9.1

提问by Pranoy C

I am following this doc for integrating realm in my iOS app.

我正在关注此文档以在我的 iOS 应用程序中集成领域。

Realm static framework for iOS

iOS 的 Realm 静态框架

My problem is in step 3. I am unable to find libc++.dylib. I find a few other .tbd ones but none of them are libc++.

我的问题在第 3 步。我找不到 libc++.dylib。我找到了其他一些 .tbd 文件,但没有一个是 libc++。

I followed a few other SO posts on using the "add other" option and doing command+shift+G and find that library but it's not in that list either.

我关注了其他一些关于使用“添加其他”选项并执行 command+shift+G 的 SO 帖子,并找到了该库,但它也不在该列表中。

Does anyone know any workarounds?

有谁知道任何解决方法?

回答by gandhi Mena

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

我有同样的问题。我找到了某种方法。

  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 : libc++.dylib and more... Compile and have fun
  1. 转到构建阶段 > 链接二进制文件 > + > 添加其他
  2. 进入文件选择窗口后,执行“CMD”+Shift+G(转到文件夹)并键入 /usr/lib/
  3. 从 /usr/lib 你可以添加:libc++.dylib 和更多...编译并玩得开心

回答by iCrany

This is a known issue in the Xcode 7 beta.

这是 Xcode 7 beta 中的一个已知问题。

To work around this issue for now, please: Delete all references to .tbdfiles from either your linked libraries phase, or from the copied bundle resources phase (where they sometimes will be added). Add the library you want to link manually to the "Other Linker Flags"build settings, by adding the argument: -l<library_name>for each library you want to link (for example, add "-lsqlite3" (without quotes)).

暂时解决此问题,请:从链接库阶段或复制的包资源阶段(有时会添加它们)删除对.tbd文件的所有引用。添加要手动链接到"Other Linker Flags"构建设置的库,方法是添加参数: -l<library_name>对于要链接的每个库(例如,添加“ -lsqlite3”(不带引号))。

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 文件是新的“基于文本的存根库”,它提供了一个更紧凑的存根库版本以供在 SDK 中使用,并有助于显着减少其下载大小。

-- copy from link

-- 从链接复制

finally, you can add -lc++in this Other link Flagssetting

最后,您可以添加-lc++Other link Flags设置

回答by Rodrigo Luiz Zini Matias

I have same problem. I cannot find libc++.dylib through xcode but I found it using terminal.

我有同样的问题。我无法通过 xcode 找到 libc++.dylib,但我使用终端找到了它。

You can copy or create a link to visible folder in xcode like /Users//Downloads.

您可以复制或创建指向 xcode 中可见文件夹的链接,例如 /Users//Downloads。

Command below maybe help to fix the problem.

下面的命令可能有助于解决问题。

ln -s /usr/lib/libc++.dylib /Users/<your user>/Downloads/libc++.dylib

回答by BenSDConway

I had a similar issue with Realm the other week after the iOS 9 update. I know you already tried the method of going to build phases, add other, CMD + shift + G without success. However this was the method I used to locate libc++.dylib and I just checked it out again now and was able find it.

在 iOS 9 更新后的前一周,我在 Realm 上遇到了类似的问题。我知道您已经尝试过构建阶段,添加其他,CMD + shift + G 的方法没有成功。然而,这是我用来定位 libc++.dylib 的方法,我现在再次检查它并且能够找到它。

It is also worth mentioning that after you do manage to add libc++.dylib you may have build errors. In which case the fix I used was to go into your target's build settings and change Enable Bitcode to No.

还值得一提的是,在您设法添加 libc++.dylib 之后,您可能会遇到构建错误。在这种情况下,我使用的修复方法是进入目标的构建设置并将启用位码更改为否。