How to Install C Plus Plus (C++) on M1/M2 macOS

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
Installing C++ on M1 - M2 Mac using brew on Mac

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

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap