1

Invoking /usr/bin/CC on my M1 mini (running macOS 11.3.1 on a case-sensitive file-system) spits out the following text and then pops up a window (below) that asks me to install the CLI tools.

CC: error: Failed to locate 'CC'. xcode-select: Failed to locate 'CC', requesting installation of command line developer tools.

Request to install CLI tools

Well, I have the Command Line Developer Tools installed (and use them daily), so why does /usr/bin/CC keep asking me?

6
  • 3
    Are you sure you do not want /usr/bin/cc? (not CC)
    – jksoegaard
    Commented Aug 26, 2021 at 22:09
  • @jksoegaard Yes, /usr/bin/cc invokes the C compiler and /usr/bin/CC is the traditional UNIX name for the C++ compiler.
    – Nemo
    Commented Aug 27, 2021 at 17:23
  • Yes, I know it is on traditional Unix systems - but Macs are usually on case-insensitive file systems - even though you aren’t. If you want the c++ compiler, why not just run “g++” instead?
    – jksoegaard
    Commented Aug 27, 2021 at 17:33
  • @jksoegaard Yes, of course -- there are all sorts of options here (c++, clang++, and so one) -- but I have two points: (1) I occasionally try to build UNIX-based s/w with scripts+Makefiles that invoke CC (and would prefer to change as little as possible); and (2) why does Xcode install both /usr/bin/CC and /usr/bin/cc?
    – Nemo
    Commented Aug 27, 2021 at 21:33
  • I have detailed it in an answer - it is a bug. I assume that stuff that invokes CC without a configure step or cmake step is some older software - so to avoid making any changes to that, I would simply install a symbolic link from /usr/bin/CC to the actual compiler.
    – jksoegaard
    Commented Aug 27, 2021 at 21:42

1 Answer 1

1

It seems you have hit a bug.

Macs usually have case-insensitive file systems, so there would be no difference between /usr/bin/cc and /usr/bin/CC. Both would be the same file, the same program.

However, that is ofcourse different when you run macOS on a case-sensitive file system.

I assume the Xcode developers at one point had considered this and installed a stub at both cc and CC on case-sensitive file systems, so that an attempt to invoke either compiler would show the prompt. Then later someone made it so that when the Xcode command line tools are actually installed, they only install the cc file, and not the CC file.

If you are an Apple registered developer, you can use Feedback Assistant to report this bug to Apple.

If you are not, then you can use the general feedback page to notify Apple about the problem.

1
  • 1
    I reported this to Apple. They claim that they cannot reproduce it. I updated to Xcode 13.0 but the same issue. So I created a script file CC in my ~/bin directory to call /usr/bin/c++,
    – Nemo
    Commented Sep 29, 2021 at 13:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .