MacOS clang via Homebrew broken under Mojave `wchar.h`

前端 未结 3 1784
一向
一向 2020-12-20 18:18

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         


        
相关标签:
3条回答
  • 2020-12-20 18:44

    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"
    
    0 讨论(0)
  • 2020-12-20 18:58

    Here's how I solved it, given I have paper deadlines and this is the least of my worries:

    1. Disabled SIP on my Mac
    2. Symlinked /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include to /usr/include as is expected in POSIX environments.
    3. Re-enabled SIP.

    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.

    0 讨论(0)
  • 2020-12-20 19:05

    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!

    0 讨论(0)
提交回复
热议问题