If you want to working with C++ (CPP) on your macOS with M1/M2 Mac then you can install it using Homebrew package manager.
The package that you need to install is called gcc, this will contain the GNU C++ compiler and binaries.
brew install gcc
Note if you install Xcode on your M1/M2 Mac, you should have gcc already installed.
Macbook % gcc --version
Apple clang version 15.0.0 (clang-1500.0.40.1)
Target: arm64-apple-darwin23.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!

Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!