문제

I ran the following to see what version of g++ I had:

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

I thought g++ was a different compiler to clang/LLVM. Can anyone clarify what the above means?

도움이 되었습니까?

해결책

In modern versions of macOS, g++ is just a little shim that points to the relevant part of clang in whichever version of Xcode you have installed.

Historically g++ was the C++ compiler that was part of the GCC compiler distribution, but Apple stopped distributing that with the operating system when they moved over to LLVM.

If you want to use the GCC distribution you can install it through homebrew.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 apple.stackexchange
scroll top