Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After install Xcode, where is clang?

Tags:

xcode

macos

I installed the newest version of Xcode.

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

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

like image 353
mko Avatar asked Sep 01 '12 13:09

mko


People also ask

Where is clang located?

By default, clang-cl.exe is located in %VCINSTALLDIR%\Tools\Llvm\bin\ and %VCINSTALLDIR%\Tools\Llvm\x64\bin\. If you're using a custom Clang installation, you can change the value of the LLVMInstallDir property.

How do I find clang on my Mac?

Enter the command clang --version to see if the Clang compilers are already installed. If you want to install or update the Clang compilers, enter the command command xcode-select --install The following pop-up windout should appear on your screen (in this example I have placed it withing the Terminal window).

Does clang come with Xcode?

Xcode's default toolchain bundled with clang 13. But clang bundled with Swift Open Source toolchain is 10 which behaves different to the default toolchain of current version of Xcode (Xcode 13.1) when compiling Swift project with C++ sources.

How do I know if clang is installed?

Open a terminal window. Enter the command (clang — version) to confirm if the Clang Compilers had already been installed.


1 Answers

Type in Terminal

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

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

You can also install Xcode Command Line Tools which will place tools and libs under standard Unix locations (/usr/bin, /usr/include etc.) if you want to be able to just type make or gcc without any paths. Note that these tools will be unrelated to the ones that Xcode application uses and may be of different versions.

like image 72
hamstergene Avatar answered Sep 23 '22 11:09

hamstergene