C++ software setup: Windows edition
Step 1: Install MSYS2
There are a number of ways to set up a C++ development environment in Windows. But to keep things as similar as possible to the course server (which runs Linux), we will be using MSYS2.
Download and run the installer from the MSYS2 GitHub. This will open an installation wizard; you can just leave all the settings at their default values and keep hitting "next" until it's done (this may take a few minutes). Then, you'll see a terminal window open. The next step should be done in this terminal window.
Step 2: Install Clang
As described in this week's lessons, in CS70 we use the Clang compiler.
There are other C++ compilers out there, but we'll stick with Clang here to be consistent with what's on the server.
But, you're free to look into other options on your own time!
To install Clang, just run the following command in the terminal:
pacman -S mingw-w64-cross-clang-toolchain
To quickly explain what this command is doing: it's invoking the package manager (or pacman for short), a program that is used for installing system-level software such as compilers. In this case, it's telling the package manager to install the package named mingw-w64-cross-clang-toolchain; that's a mouthful but tl;dr this package contains Clang!
Note: If the package manager asks you to "make a selection", just hit enter to accept the default.
To test whether the installation worked, run the following command in the terminal:
clang++ --help
This should print a massive chunk of documentation for the Clang compiler, which should start with something like the following:
OVERVIEW: clang LLVM compiler
USAGE: clang [options] file...
OPTIONS:
Step 3: Install Git
The easiest way to install Git on Windows is directly through VS Code.
Open VS Code, but make sure that you do not connect the VS Code window to the CS 70 server. To verify, the bottom left corner of VS Code should show only the and should not say connected to cs70.cs.hmc.edu or anything like that.
In the VS Code sidebar, click the "source control" button (that's the one that looks like three circles connected by two lines). You should then see a button at the top to "install Git for Windows". Go ahead and click that button; it will take you to the official Git website to download the Git for Windows installer. Download and run the Git for Windows installer; like before, you can just leave all the settings at their default values and keep hitting "next" until it's done.
If you don't see an "install Git for Windows" button, you probably already have Git installed from a previous class, research, internship, or project, so you're good to go and you can just move on.
(When logged in, completion status appears here.)