首页 文章

macos致命错误:sys / _types / _int8_t.h:没有这样的文件或目录#include <sys / _types / _int8_t.h>

提问于
浏览
0

我最近更新了系统macOS Mojave 10.14并遇到了以下问题 . 我不打算通过gcc(我的版本8.2)和clang(7.0)使用项目 . 问题是程序,据我所知,没有找到标准库,并给出了像这样的所有错误:

/usr/local/bin/g++-8 -I//Users/MyNames/Desktop myFile.cpp -MyFinalFile -std=c++2a
In file included from /usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/includ e/stdint.h:9,
from builddest.cpp:1:
/usr/local/Cellar/gcc/8.2.0/lib/gcc/8/gcc/x86_64-apple-darwin17.7.0/8.2.0/includ e-fixed/stdint.h:27:10:fatal error: sys/_types/_int8_t.h: No such file or directory

    #include <sys/_types/_int8_t.h>

根据包含的头文件,我得到不同的错误 . 在互联网上我发现了一些提示,例如:重新安装XCode(我安装的版本10.0(10A255)),安装命令行工具 - 我重新安装,但没有任何帮助 . 在XCode中一切正常 . 我的系统是mac mini 2012,macOS 10.14 . 在升级之前,一切都很完美 . 我会很乐意为你提供任何帮助 . 如果你根本不添加任何依赖项,那么一切都很顺利 .

1 回答

  • 1

    在Mojave更新后,您需要重新安装Homebrew和GCC . GCC工具链多年未包含在MacOS中 . 从 cellar 目录中可以看出,您使用的是Homebrew安装的GCC版本 .

    请查看Homebrew documentation并进行Homebrew和GCC的全新安装 . 请注意,您仍然需要Xcode命令行工具来安装和使用Homebrew .

相关问题