mac fatal error: 'stdlib.h' file not found

旧时模样 提交于 2020-03-13 13:30:53

//1.检查头文件是否存在

$clang++ -E -x c++ - -v < /dev/null

ignoring nonexistent directory "/usr/include/c++/v1"
ignoring nonexistent directory "/usr/include"

注:说明macOS SDK 的头文件不存在

//2.安装xcode-select

$xcode-select --install 

//3.获取header pkg

$xcode-select -p 

//4.查看config

$brew config

//5.安装头文件

$ cd /Library/Developer/CommandLineTools/Packages/

$ open macOS_SDK_headers_for_macOS_10.14.pkg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!