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.
This stack overflow post provides a lot more detail about the missing stdlib.h
header, but the second suggestion I've given here seemed to be the solution there too.