美文网首页iOS错误&解决
iOS编译错误-Include of non-modular h

iOS编译错误-Include of non-modular h

作者: Billlin | 来源:发表于2018-06-19 10:13 被阅读0次

描述:

在SDK开发过程中,我们自己的framework库中的一个.h文件引用了pod库中的类。

import <DateTools/DateTools.h>

这时候以源码的形式build是没有问题的,但是当build出静态库后,添加到其他项目中使用时,就报 Include of non-modular header inside framework module xxxx错误。

为什么会这样呢?
因为Xcode在默认情况下是不允许在framework中的头文件引入一个不属于任何Module的头文件。

那应该怎么解决呢?
方式一:
target 下的 Build Settings 中的 Allow Non-modular includes in Framework Modules 设置成YES。

方式二:
将#import "**.h" 第三方库写在 .m文件中,而不是放在.h文件中。

参考

# Include of non-modular header inside framework module

相关文章

网友评论

    本文标题:iOS编译错误-Include of non-modular h

    本文链接:https://www.haomeiwen.com/subject/fxppeftx.html