gpt4 book ai didi

xcode - macOS Catalina 上缺少系统 header (/usr/include)

转载 作者:行者123 更新时间:2023-12-03 17:08:27 24 4
gpt4 key购买 nike

我刚刚安装了 macOS Catalina 10.15 GM。
不幸的是,我的应用程序框架都无法编译。找不到系统头文件。
在 macOS Mojave 上有一个解决方法,但它不再有效,文件不会被下载(解决方法解释为 here)

输入时 xcrun --show-sdk-path , /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk印在终端上。此文件夹还包含所有必需的标题。我如何告诉 Xcode 使用这些文件?

这是我的 module.modulemap 的样子:

module PrivateNetwork [system]
{
header "/usr/include/sys/socketvar.h"
header "/usr/include/net/if_dl.h"
header "/usr/include/net/if_types.h"
header "/usr/include/net/if.h"
header "/usr/include/netinet/in.h"
header "/usr/include/netinet/tcp.h"

header "/usr/include/netinet/tcp_var.h"
header "/usr/include/netinet/tcpip.h"
header "/usr/include/netinet/tcp_fsm.h"
header "/usr/include/netinet/ip.h"
header "/usr/include/netinet/ip6.h"

export *
}

错误: Header '/usr/include/sys/socketvar.h' not found

最佳答案

您可以将 CPATH 设置为头目录。

export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"

关于xcode - macOS Catalina 上缺少系统 header (/usr/include),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58232595/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com