Swift 编译器错误:“框架模块内的非模块化头文件" [英] Swift compiler error: "non-modular header inside framework module"

查看:46
本文介绍了Swift 编译器错误:“框架模块内的非模块化头文件"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在我想将我的 ObjC 框架迁移到 Swift,但出现以下错误:

Now I would like to migrate my ObjC framework to Swift and I got the following error:

include of non-modular header inside framework module 'SOGraphDB'

引用的是一个头文件,它只是定义了一个协议,我在一些类中使用这个头文件来使用这个协议.

The references is to a header file which just define a protocol and I use this header file in some classes to use this protocol.

似乎与模块功能有关,但目前不太清楚如何修复,您知道解决方案吗?

Is seems related to the module feature but it is at the moment not quite clear how to fix, do you know a solution?

更新:

这是一个 Swift 编译器错误.

This is a Swift compiler error.

更新 2:

快速修复(但不能解决根本原因)是将以下设置设为是:CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = 是

A quick fix (but not solving the root cause) is to set the following setting to yes: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES

推荐答案

你的标题是公开的吗?

在项目资源管理器中选择头文件.然后在 xcode 右侧的部分中,您会注意到目标旁边有一个下拉列表.将其从项目"更改为公共".这对我有用.

Select the header file in the project explorer. Then in the section on the right in xcode, you'll notice there is a dropdown next to the target. Change that from "project" to "public". This worked for me.

这篇关于Swift 编译器错误:“框架模块内的非模块化头文件"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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