加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

swift – 包含libxml2和LLVM模块映射

发布时间:2020-12-14 04:55:55 所属栏目:百科 来源:网络整理
导读:在尝试构建我创建的 Swift包时,我使用LLVM模块映射来包含来自/usr/include / libxml2 /的libxml2,我收到以下错误: Compiling Swift Module 'foo' (1 sources)module-includes2:9: note: in file included from module-includes:2: #import "/usr/include/li
在尝试构建我创建的 Swift包时,我使用LLVM模块映射来包含来自/usr/include / libxml2 /的libxml2,我收到以下错误:

Compiling Swift Module 'foo' (1 sources)
<module-includes>2:9: note: in file included from <module-includes>:2: 
#import "/usr/include/libxml2/libxml/catalog.h"

/usr/include/libxml2/libxml/catalog.h:22:10: error: 'libxml/xmlversion.h' file not found

这是我的模块图:

module Clibxml2 [system] {

    umbrella "/usr/include/libxml2"
    export *
}

我的虚拟main.swift文件现在只尝试导入模块:

import Clibxml2

当我尝试使用另一个头路径/伞(例如/usr/include / CommonCrypto)时,它会编译.我确认xmlversion.h确实存在于/usr/include / libxml2 / libxml中.我错过了什么吗?

解决方法

Swift现在有一个 -Xcc option,可以用来传递额外的编译器标志:

swift build -Xcc -I/usr/include/libxml2

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读