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
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
worked like a charm for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With