HT206770: About the OS X El Capitan v10.11.6 Update

Learn about About the OS X El Capitan v10.11.6 Update
darrenfromdavie

Q: How do I go about using the clang compiler from command line?

It is said in the new update clang is a command line tool.

MacBook Air (13-inch, Early 2015), OS X El Capitan (10.11.6)

Posted on Sep 5, 2016 4:43 PM

Close

Q: How do I go about using the clang compiler from command line?

  • All replies
  • Helpful answers

  • by VikingOSX,Helpful

    VikingOSX VikingOSX Sep 12, 2016 5:36 AM in response to darrenfromdavie
    Level 7 (20,633 points)
    Mac OS X
    Sep 12, 2016 5:36 AM in response to darrenfromdavie

    Do you have, or wish to develop, C, C++, Objective-C, or Objective-C++ code that you want to compile on the command line with the clang compiler? It is an optional install, and not included with OS X.

  • by darrenfromdavie,

    darrenfromdavie darrenfromdavie Sep 12, 2016 5:37 AM in response to VikingOSX
    Level 1 (4 points)
    Mac OS X
    Sep 12, 2016 5:37 AM in response to VikingOSX

    How do I go about doing that?

  • by Luis Sequeira1,

    Luis Sequeira1 Luis Sequeira1 Sep 12, 2016 6:05 AM in response to darrenfromdavie
    Level 6 (11,948 points)
    Sep 12, 2016 6:05 AM in response to darrenfromdavie

    The easiest way is to Install XCode from the App Store.

    Then in XCode you can download the command line tools by going to  XCode->Preferences->Downloads, locate the command line tools in the list and click Install.

  • by VikingOSX,

    VikingOSX VikingOSX Sep 12, 2016 8:28 AM in response to Luis Sequeira1
    Level 7 (20,633 points)
    Mac OS X
    Sep 12, 2016 8:28 AM in response to Luis Sequeira1

    Xcode 7.3.n no longer has the Xcode : Preferences : Download panel, and Xcode : Open Developer Tool : More Developer Tools… the link is broken.

     

    If the OP is not going to be developing Cocoa user interface applications, then just downloading the command-line tools for his current release of OS X is sufficient, and far less consuming of storage.

     

    In Safari, one visits developer.apple.com/download/more/ and then as the OP is using El Capitan 10.11.6, downloads the following (may require free developer account to access):

     

    Command Line Tools (OS X 10.11) for Xcode 7.3.1

     

    This will install the released OS X compilation environment including the Swift interpreter and compiler.