我使用的是 mac 版本 10.13.6。
我想通过终端编译C程序。我已经下载了 Xcode 和命令行工具。当我在终端中键入 clang --version
时,我收到以下两条错误消息:
clang: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!
clang: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch
我做了一些谷歌搜索并找到了修复 here .解决方案是在终端中运行以下行:
sudo xcode-select -switch/Applications/Xcode.app/Contents/Developer
我做到了。但是当我在执行此操作后输入 clang --version
时,我得到完全相同的两个错误。怎么回事?
注意:对此非常陌生,所以请在回答时记住这一点!干杯
最佳答案
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
对我来说就像一个魅力
关于 clang : error: unable to locate xcodebuild,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52563692/