After installing Xcode, where is clang?

I installed the latest version of Xcode.

gcc,cc,clang , any of them exist in the terminal.

How can I find the c compiler in a terminal that uses Xcode?

+8
xcode macos
source share
4 answers

Such commands were made in a separate "command line tool" package with or near Xcode 4.3

They were ported to the Xcode.app package as part of the Xcode creation of a more standard version of the App Store. Separate CLI tools are also useful for projects like Homebrew that don't need to fully load Xcode

To install ( here ):

  • Open xcode
  • Go to settings
  • Select "Download" and click "Install for command line tools" (about 171 megabytes).

Xcode command line tools Download page screenshot

+9
source share

Enter terminal

 xcodebuild -find make xcodebuild -find gcc xcodebuild -find g++ xcodebuild -find clang xcodebuild -find clang++ 

Each command prints the full path to the corresponding tool. These are the ones used by Xcode.

You can also install Xcode command line tools that will host tools and libraries at standard Unix locations ( /usr/bin , /usr/include , etc.) if you just want to type make or gcc without any path. Please note that these tools will not be related to the fact that the Xcode application uses and may have different versions.

+25
source share

It seems to have moved: jarmac: ~ jar $ xcodebuild -find clang /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang

+2
source share

Included Xcode application:

 /Applications/Xcode.app/Contents/Developer/usr/bin/ 
+1
source share

All Articles