How to get the default compiler of c++ on Mac os x I am new in c++ on Mac os x and I need to know how to get some details:


How to get the default compiler c++/c?
How to change the default compiler?
How to set the compiler in a CMakelists.txt file when using CMake?
I don't think Mac come with a C/C++ compiler by default anymore. I recommend that you install XCode and XCode commandline tools from the App Store. That will give you the gcc compiler (and probably LLVM as well).

Without knowing your build process, I can't tell you how to set a default compiler. There will be an option in XCode as well as options with command-line build tools. IOW, Macs do not have a system-wide default compiler setting that I'm aware of.

Here's the official documentation on how to use a different compiler with CMake.
https://gitlab.kitware.com/cmake/community/wikis/FAQ#how-do-i-use-a-different-compiler