8

I just installed the macOS Catalina 10.15 GM. Unfortunately none of my app frameworks compile. The system header files were not found. On macOS Mojave there was a workaround, but it no longer works, the file won't be dowloaded (the workaround is explained here)

When typing xcrun --show-sdk-path, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk is printed on the Terminal. This folder also contains all the required headers. How can I tell Xcode to use those files?

This is how my module.modulemap looks like:

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 *
}

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

4

2 回答 2

6

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

export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"
于 2019-10-17T15:51:54.827 回答
0

为了解决这个问题,我简单地添加了模块映射的完整路径。如果有更好的方法,请告诉我,但至少现在文件编译(我还必须重新排序条目):

module PrivateNetwork [system]
{
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/sys/socketvar.h"

    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/ip.h"
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/ip6.h"

    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/tcp_fsm.h"
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/tcp_var.h"
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/netinet/tcpip.h"

    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/net/if_types.h"
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/net/if.h"
    header "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/net/if_dl.h"

    export *
}
于 2019-10-08T17:25:57.753 回答