Unsurprisingly the new update of OSX Mojave broke my llvm installation in Homebrew, these are the steps I tried:
xcode-select --install # Complained, so I in
This is a well known issue of the latest macos. Try to set this environment variable, it must fix this issue.
export LIBCLANG_SYSTEM_INCLUDE_DIR="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
Here's how I solved it, given I have paper deadlines and this is the least of my worries:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
to /usr/include
as is expected in POSIX environments.Now I got to make a note to re-do this everytime a new OSX update comes out. This has not broken anything wrt Xcode, clang (from brew) etc so I'll keep it. Be advised though, this might break your stuff.
I did something dumb but it did fix the problem... Not sure if it will work for your computer though.
Here is what I did:
I originally installed c++ using Homebrew on my MacBook on Mojave... so I had to manually install the Xcode CommandLineTools using the installer found at /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
. Then I copied the "c++" folder contents from to folder /Library/Developer/CommandLineTools/usr/include/c++/v1
to the folder where I want the missing file to be, at /usr/local/Cellar/gcc/8.2.0/include/c++/8.2.0
, while replacing files with the same names.
The trick worked, since now the missing file "wchar.h" is right where it should be... I could have simlinked, in hindsight. Cheers!