【发布时间】:2016-11-22 15:50:57
【问题描述】:
我使用一个命令:g++ -v 来了解当前使用的 GCC 版本。但我得到以下输出:
$ g++ -v
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.1.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
所以我不明白。当我使用 g++ test.cpp 编译我的程序时,我使用的是 LLVM 还是 GCC?为什么我在请求有关 GCC 的信息时会看到有关 LLVM 的信息? LLVM 与 Clang 一起用作前端。
我错过了什么?
【问题讨论】:
-
试试 g++ --version?
-
试试看g++是不是linux上的别名你可以用'alias g++'