Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

clang: error: unable to locate xcodebuild

I am using a mac version 10.13.6.

I want to compile C programs through the terminal. I've downloaded Xcode and the command line tools. When I type clang --version in the terminal, I get the following two error messages:

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

I did some googling and found a fix here. The solution is to run the following line in terminal:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Which I did. But when I enter clang --version after doing this, I get exactly the same two errors. What's going on?

NB: very very new to this so please keep that in mind when answering! cheers

like image 775
ctt25 Avatar asked Sep 28 '18 23:09

ctt25


1 Answers

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer 

worked like a charm for me

like image 57
AdamWinsche Avatar answered Sep 30 '22 13:09

AdamWinsche