升级Mojave之后, 再安装R包的时候,会报错,其中的一个错误:
fatal error: 'stdlib.h' file not found # include <stdlib.h> /* Not used by R itself, but widely assumed in packages */ ^~~~~~~~~~
这个是最主要的错误,主要就是xcode更新之后,R找不到c的头文件
解决方法:
xcode-select --install
- Run
installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
After upgrading to Mojave myself, and seeing a couple issues, I've determined two things you generally need to do to get up and running again. Both at the command line:
xcode-select --install
- Run
installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
which has been related to a number of strange issues (including one with rcpp autocomplete and with xml2)
You may need to use sudo
with the second command.