Why Xcode Command Line Tools is necessary? Why Xcode or self-installed ones don't work? #5408
Answered
by
Bo98
xycabcd
asked this question in
Everyday usage
-
Beta Was this translation helpful? Give feedback.
Answered by
Bo98
May 27, 2024
Replies: 1 comment 2 replies
-
For the same reason a phone won't work when you need a screwdriver. They're not the same and Homebrew depends on the CommandLine Tools. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GCC uses the macOS SDK. The Command Line Tools are installed in a fixed location so we can always find the SDK at
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
.Xcode app however can be installed anywhere on the system - it might be
/Applications/Xcode.app
, but not always. GCC doesn't have code that tries to search the system for SDK like Apple's Clang does, so the SDK at/Library/Developer/CommandLineTools
is the one used.If you aren't using the latest macOS version, there's an additional reason: the Xcode app doesn't ship the macOS SDK for older macOS but the Command Line Tools does.