None of the above worked for me. I originally installed Command Line Tools separately, and then all of Xcode. What worked for me was to uninstall Command Line Tools as shown here. Then, when trying to run xcode-select
again, I was asked to reinstall them.
*By the way, the very reason why I found this thread was because I had installed some libraries (particularly gcc
) with macports
, presumably using the old Command Line Tools, and then I installed the full Xcode midway into development. So anyways, for my case, I had to reinstall macports
after removing the stand-alone Command Line Tools, reinstalling them, reinstalling gcc
, and then my compilation worked.