After updating to macOS Mojave, the the OS fails to search for headers in /usr/local/include
when compiling with clang++
(from the command-line, i.e. outside Xcode). Note that /usr/local/include
is for my system the default paths in which CMake installs the headers, it thus feels quite strange of having to manually include this.
Incidentally I have also performed a clean install, resulting in the same problem. In the latter I have, in the following order:
- Installed Xcode from the App-store.
- Ran
xcode-select --install
.
The problem appears to be similar as in this question where it is suggested to:
- Run
xcode-select --install
. This obviously does not solve the problem. Insisting on this by rerunning the install command results inerror: command line tools are already installed
. - Then there is the suggestion to check the output of
xcode-select -p
. It should apparently read/Library/Developer/CommandLineTools
, not/Applications/Xcode.app/Contents/Developer
as in my case. The suggestion is to "delete [sic] Xcode from the Applications directory", which seems to be a bit brutal.
How to solve this?