Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Missing system headers (/usr/include) on macOS Catalina

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

like image 367
inexcitus Avatar asked Oct 04 '19 08:10

inexcitus


People also ask

Where is usr include on Mac?

app/Contents/Developer/Platforms/MacOSX. platform/Developer/SDKs/MacOSX. sdk . From there, usr/include holds common public headers.

Where is Stdio H on Mac?

The <stdio. h> header file is part of the C standard library, and may be in any directory that the compiler searches for header files, it may be in a sub-directory to /usr/lib for example. Also, the command find ./ -iname "stdio.


1 Answers

You could set the CPATH to the header directory.

export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"
like image 125
marceloow Avatar answered Oct 01 '22 14:10

marceloow