Skip to content

Setup C++ development environment on macOS

Homebrew

Install Homebrew:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Development Tools

Xcode

Install Command Line Tools (CLT) for Xcode:

xcode-select --install

CMake

brew install cmake

ninja

brew install ninja

Misc

Finder

Show hidden files:

defaults write com.apple.finder AppleShowAllFiles YES

Hold the 'Option/alt' key, then right click on the Finder icon in the dock and click Relaunch

Troubleshooting

If you get:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Try this:

softwareupdate --all --install --force

If that doesn't show you any updates, run:

 sudo rm -rf /Library/Developer/CommandLineTools
 sudo xcode-select --install