iOS:“包含非
我正尝试构建自己的框架“VBL”,该框架使用基于libxml.dylib的TouchXML
该框架构建得很好,但每当我尝试在任何项目中使用它时,我都会遇到以下错误:
"Include of non-modular header inside framework module VBL.CXMLNode"
这是因为在我的框架中的头文件CXMLNode.h中,我必须包含libxml,如下所示:
#include <libxml/tree.h>
将Build Settings中的以下属性设置为YES是否安全?
allow non-modular included in framework modules
但是这对Swift无效,所以还有其他建议吗?
如果可以的话,您可以尝试隐藏私有头文件或.m文件中的#include <libxml/tree.h>
。
你也可以尝试用libxml根头文件创建一个module.modulemap
文件来欺骗swift编译器:
module Libxml [system] {
header "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2/libxml/tree.h"
export *
}
然后将文件放在文件夹中,例如-module / module.modulemap。
一旦你这样做了,你应该将它链接到目标build setting
的swift compiler search path
部分中的import paths
中,并链接到目标的header search path
:
$(SRCROOT)/module
然后在你的代码中,你可以使用@import libxml;
上一篇: iOS: "Include of non