clang : error: unable to locate xcodebuild

标签 c xcode macos macos-high-sierra command-line-tool

我使用的是 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/

相关文章:

macos - 操作系统 X 10.10。 Yosemite Clang 和 GCC 版本

c - 打开和关闭位的最优雅的方式

c - 不确定这行代码在c中的作用

c - C中的链表排序函数

c++ - 控件可能会到达非空函数 xcode 的末尾

xcode - 在大团队中使用 git VS Mercurial 和 Xcode 进行 iOS 开发有什么优缺点?

c - 在 C 中逐行读取 X&Y 坐标并将它们存储在不同的数组中

objective-c - Xcode - 基于文档的应用程序(文档包)

xcode - 在库的 Mac OS X SDK 中包含调试版本

cocoa - Cocoa 中的 WebView 不接受击键?