Отсутствуют системные заголовки (/ usr / include) в macOS Catalina - PullRequest
2 голосов
/ 04 октября 2019

Я только что установил macOS Catalina 10.15 GM. К сожалению, ни одна из моих приложений не компилируется. Заголовочные файлы системы не найдены. В MacOS Mojave был обходной путь, но он больше не работает, файл не будет загружен (обходной путь объяснен здесь )

При вводе 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

Ответы [ 2 ]

3 голосов
/ 17 октября 2019

Вы можете установить CPATH в каталог заголовка.

export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/"
0 голосов
/ 08 октября 2019

Чтобы решить эту проблему, я просто добавил полный путь к карте модуля. Если есть лучший подход, пожалуйста, дайте мне знать, но, по крайней мере, теперь файл компилируется (мне также пришлось изменить порядок записей):

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