Yosemiteにコマンドラインツールを入れる
コマンドラインツールのみ必要な場合は、1行「xcode-select --install」と打って「インストール」を選択するだけでいいらしい。(最近のOS Xでは簡素化された)
詳しくは下記参照。
自分は誤って「Xcode を入手」を選択しまい、ダウンロードがなかなか終わらないので、今この記事を書いている。
Xcodeがインストールされたあとの確認。
$ which gcc /usr/bin/gcc $ xcode-select -p /Applications/Xcode.app/Contents/Developer $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
仕切り直し、再トライ。
$ xcode-select --install xcode-select: note: install requested for command line developer tools
$ which gcc /usr/bin/gcc $ xcode-select -p /Applications/Xcode.app/Contents/Developer $ gcc --version Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix
インクルードの場所が変わっていた。