2017-02-06 10 views
1

最近のMac OS Xのバージョンではgcc(g ++)を使用していないことは知っています。 gccやg ++と入力すると、OSは実際にClang(cc)を使います。OS XでgccのClangのバージョンをアップグレードするにはどうすればよいですか?

$ g++ --version 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn) 
Target: x86_64-apple-darwin12.2.0 
Thread model: posix 

ただし、ファイルシステムに埋もれ別のより最近のクランがあります:今

、私はLLVMのバージョン4.2(打ち鳴らす-425.0.28)とOS X 10.8.2を実行している、XCodeを介してインストールバージョン:

$ clang --version 
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) 
Target: x86_64-apple-darwin12.2.0 
Thread model: posix 

どうすればgccにClang 425の代わりに「リンク」することができますか?

答えて

1

あなたの両方の利用可能な最新バージョンを提供しますXcodeの、インストール: `Xcodeの選択:エラー:` --install`パラメータがここに欠けているようだ

xcode-select --install 
... 

$ g++ --version 
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 
Apple LLVM version 8.0.0 (clang-800.0.42.1) 
Target: x86_64-apple-darwin16.4.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 

$ clang --version 
Apple LLVM version 8.0.0 (clang-800.0.42.1) 
Target: x86_64-apple-darwin16.4.0 
Thread model: posix 
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin 
+0

を未知のコマンドオプション「 - 「インストールする」。私はxcode-selectバージョン2311を使用しています。 – Ignorant

+0

Mac App StoreからXcodeをインストールする必要があるかもしれません。https://itunes.apple.com/us/app/xcode/id497799835?mt=12 – sideshowbarker

関連する問題