- Install the Xcode Command Line Tools
xcode-select --installA window pops up. Click Install and wait a few minutes. You don't need the full Xcode app.
Check it worked
- Check the compiler works
xcode-select -p && clang --version
Undo it
- Remove the Command Line ToolsNeeds sudo
sudo rm -rf /Library/Developer/CommandLineTools
- Install gcc, make and the usual build toolsNeeds sudo
sudo apt install -y build-essential
Check it worked
- Check the compiler works
gcc --version && make --version
Undo it
- Remove the build toolsNeeds sudo
sudo apt remove -y build-essential
- Install the Visual Studio C++ build tools
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended"About 5 GB. You only need the build tools, not the full Visual Studio.
Check it worked
- Check the compiler works
clRun this in "Developer PowerShell for VS 2022" from the Start menu. It prints the compiler version.
Undo it
- Remove the build tools
winget uninstall Microsoft.VisualStudio.2022.BuildTools