Broken c++ std libraries on macOS High Sierra 10.13

前端 未结 5 577
庸人自扰
庸人自扰 2020-12-04 19:28

I recently bought a new MacBook on which I transferred my old session. Since then, and after i upgraded to 10.13, i can\'t get clang to compile anything including only iostr

相关标签:
5条回答
  • 2020-12-04 19:49

    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).

    0 讨论(0)
  • 2020-12-04 19:52

    I had a similar issue that after upgrading to high sierra (and Xcode 9.1) that my standard make reported unfamiliar warnings.

    It drew .h files from /usr/local/include instead from the (as I thought) standard /usr/include. For example, there was no zlib.h available.

    Reinstalling Xcode (who claims to install the commandline version too) did not help.

    There was no /usr/include at all but the C++ system include were available through the links reported in clang --version, but none of the C-includes.

    After xcode-select --install and actually "install" of the commandline material the /usr/include was populated with the necessary C libraries, and make started to compile without warnings again.

    0 讨论(0)
  • 2020-12-04 19:57

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

    0 讨论(0)
  • 2020-12-04 19:59

    Check that you don't include "/usr/local/include" into headers search path of your project.

    0 讨论(0)
  • 2020-12-04 20:08

    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

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