[Solved] C++ programs on Mac OS


A default macOS installation will include something that pretends to be gcc but that’s just a legacy concern so that portable programs will properly detect a compiler when you do a source install with the usual ./configure && make && make install or use a package manager like Homebrew.

Xcode used to use gcc as a back-end prior to clang being production-ready. When this switch was done a gcc work-alike stub was introduced. As far as I know this just takes gcc-style options and forwards them to clang.

While GCC and the LLVM clang project are two different things, the gcc command is not necessarily attached the GCC compiler.

Many programs masquerade as others for historical reasons. sendmail also comes with macOS but this is a wrapper for Postfix. The Safari browser identifies itself as “Mozilla” even though it has nothing in common with the Mozilla codebase. You’ll see these various compatibility stubs all over the place if you look close enough.

2

solved C++ programs on Mac OS