1

我有一个具有以下文件结构的 Xcode 项目:

MyPlugin.xcodeproject
    sdk.xcconfig
    MyPlugin.c
    MyPlugin.swift
    MyPlugin-Bridging-Header.h

如果我从目标中删除 MyPlugin.swift,一切都编译得很好。将其添加到目标会输出以下错误:

Swift 编译器错误:找不到“Files.h”文件

内容MyPlugin-Bridging-Header.h很简单:

#include "sdk.h"

在搜索路径中可以正确找到它,但是它具有以下行,这sdk.h是发生错误的地方。

#include <Files.h>

我搜索的所有内容都提到了创建一个module.modulemap文件,所以我已经尝试过以下操作,但它不能修复错误:

module Files [system] {
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/Files.h"
    export *
}

我目前想知道如果#include我要修复的语句在 sdk.h 中而不是直接在桥接头中,这个模块映射是否会起作用?

附加设置信息:

Xcode 10,Swift 4.2,部署目标:10.9,架构:x86_64

4

0 回答 0