Compiler fails to search “/usr/local/include” after updating to macOS Mojave

隐身守侯 提交于 2019-11-29 09:53:45

问题


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:

  1. Installed Xcode from the App-store.
  2. 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 in error: 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?

来源:https://stackoverflow.com/questions/52519492/compiler-fails-to-search-usr-local-include-after-updating-to-macos-mojave

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!