title: clang: error: unable to locate xcodebuild
body: <p>I am using a mac version 10.13.6.</p>
  <p>I want to compile C programs through the terminal. I've downloaded Xcode and the command line tools. When I type <code>clang --version</code> in the terminal, I get the following two error messages:</p>
  <blockquote>
  <p>clang: error: unable to locate xcodebuild, please make sure the path to the Xcode folder is set correctly!</p>
  <p>clang: error: You can set the path to the Xcode folder using /usr/bin/xcode-select -switch</p>
  </blockquote>
  <p>I did some googling and found a fix <a href="https://stackoverflow.com/a/31780545">here</a>. The solution is to run the following line in terminal:</p>
  <p><code>sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer</code></p>
  <p>Which I did. But when I enter <code>clang --version</code> after doing this, I get exactly the same two errors. What's going on?</p>
  <p>NB: very very new to this so please keep that in mind when answering! cheers</p>