First things

Install developer build tools

The compilers and build tools that many other installs quietly need (C compiler, make and friends).

  1. Install the Xcode Command Line Tools
    Terminal
    xcode-select --install

    A window pops up. Click Install and wait a few minutes. You don't need the full Xcode app.

Check it worked

  1. Check the compiler works
    Terminal
    xcode-select -p && clang --version
Undo it
  1. Remove the Command Line ToolsNeeds sudo
    Terminal
    sudo rm -rf /Library/Developer/CommandLineTools
  1. Install gcc, make and the usual build toolsNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt install -y build-essential

Check it worked

  1. Check the compiler works
    Terminal · Ubuntu / Debian
    gcc --version && make --version
Undo it
  1. Remove the build toolsNeeds sudo
    Terminal · Ubuntu / Debian
    sudo apt remove -y build-essential
  1. Install the Visual Studio C++ build tools
    PowerShell
    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

  1. Check the compiler works
    PowerShell
    cl

    Run this in "Developer PowerShell for VS 2022" from the Start menu. It prints the compiler version.

Undo it
  1. Remove the build tools
    PowerShell
    winget uninstall Microsoft.VisualStudio.2022.BuildTools