Xcode 7.3 Beta 1与Swift中的CommonCrypto [英] Xcode 7.3 beta 1 vs. CommonCrypto in Swift

查看:181
本文介绍了Xcode 7.3 Beta 1与Swift中的CommonCrypto的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Swift框架中使用CommonCrypto-并且已经运行了一年多.

I'm using CommonCrypto in a Swift framework - and it's been working fine for over a year.

我使用了以下解决方案:在Swift框架中导入CommonCrypto

I used solutions found here: Importing CommonCrypto in a Swift framework

具体来说,要从Swift框架引用CommonCrypto,我必须:

Specifically, to reference CommonCrypto from the Swift framework, I had to:

在框架的Xcode项目旁边的名为CommonCrypto的文件夹中创建一个module.map文件. module.map内容:

Create a module.map file in a folder named CommonCrypto next to my framework's Xcode project. module.map contents:

module CommonCrypto [system]
{
    header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/usr/include/CommonCrypto/CommonCrypto.h"
    link "CommonCrypto"
    export *
}

  • 在我的框架项目的Swift Import Paths中,添加CommonCrypto
  • 在我的框架项目的库搜索路径"中,包括: $(SDKROOT)/usr/lib/system
  • 在我的资料中,我包括:import CommonCrypto
    • In my framework project's Swift Import Paths, I add CommonCrypto
    • In my framework project's Library Search Paths, I include: $(SDKROOT)/usr/lib/system
    • In my source, I include: import CommonCrypto
    • 这很好用;有点令人费解-但却奏效了.

      This worked fine; a little convoluted - but it worked.

      但是,在Xcode 7.3 beta 1(7D111g)中,该技术不再起作用.

      However, in Xcode 7.3 beta 1 (7D111g), this technique no longer works.

      似乎已从Xcode-beta.app中的$(SDKROOT)/usr/lib/system中删除了libcommonCrypto.tbd.而且在iPhoneOS SDK文件夹结构下的任何地方都找不到它.

      It appears that libcommonCrypto.tbd has been removed from: $(SDKROOT)/usr/lib/system inside Xcode-beta.app. And I can't find it anywhere under the iPhoneOS SDK folder structure.

      所以我得到了这些错误:

      So I get these errors:

      ld:警告:找不到选项的目录 '-L/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib/system' ld:找不到用于架构arm64 clang的-lCommonCrypto的库: 错误:链接器命令失败,退出代码为1(使用-v查看 调用)

      ld: warning: directory not found for option '-L/Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/usr/lib/system' ld: library not found for -lCommonCrypto for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

      如果将疯狂的模块地图业务替换为更简单的产品,那就太好了.例如,仅使用import CommonCrypto

      It would be great if the crazy module map business was replaced with something simpler. Like for instance, just using import CommonCrypto

      无论如何,我不确定如何解决此问题,因此不胜感激.

      In any case, I'm not sure how to resolve this, so any help is appreciated.

      如果解决方案与上一个问题中的解决方案有很大不同,我在这里要提出一个新问题,尽管我知道这可能不合适.

      I'm asking here as a new question in the event that the solution is substantially different from solutions found in the previous question, although I appreciate this may not be appropriate.

      推荐答案

      解决方案似乎是删除该行:

      It looks like the solution is to remove the line:

      link "CommonCrypto"
      

      来自module.map文件.

      from the module.map file.

      这篇关于Xcode 7.3 Beta 1与Swift中的CommonCrypto的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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