卸载后构建工具损坏 Xcode

Build tools broken after uninstalling Xcode

当我在安装和卸载 xcode 后从命令行(cmake ..make)使用 make 构建我的 C++ 项目时,make 输出 make[2]: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++: No such file or directory

xcode-select -p 输出: /Library/Developer/CommandLineTools

sudo xcode-select --install 输出: xcode-select: error: command line tools are already installed, use "Software Update" to install updates

xcode-select --reset 输出:无

我卸载并重新安装了 xcode 命令行工具,它仍然给出相同的没有这样的文件或目录错误

CMake 将其系统自检的结果存储在一个名为 CMakeCache.txt 的文件中——所用编译器的完整路径就是其中之一。 如果您更改系统中的某些内容使这些结果无效,您需要清除缓存,即删除构建文件夹中的 CMakeCache.txt 文件。