Broken c++ std libraries on macOS High Sierra 10.13

I had the same issue after upgrading to MacOS Mojave 10.14.4 and Xcode 10.2

The issue got resolved, after installing the package /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg


I had exactly the same problem today and after executing xcode-select --install, everything works fine!


Same error I encountered on golang recently.

This was my solution: rm -rf /usr/local/include

I'm guessing the higher version of MacOS (I'm currently on BigSur) doesn't need that folder anymore so you might save a little bit of storage space if the folder is going to be deleted.


I had exactly the same problem after transferring to macOS High Sierra (though, errors were not the same, but similar).

I found a workaround by renaming /usr/local/include to /usr/local/include_old (well, name does not really matter, just the fact that g++/clang will not search for headers in this folder anymore).