C++ development environment setup

1. Create an account on GitHub.com

We distribute all machine problem (MP) starter codes through the GitHub classroom. To accept the assignments, you will need a GitHub account. If you haven't an account with GitHub or would like to create a new handle for this course,

  1. Navigate your browser to github.com,
  2. click the Sign Up link, and
  3. create an account!

2. Install git on your system

We will use git to interact with your assignment repositories on github.com and, more broadly, for source code version control in this course. Accordingly, the next step is to download and install git on your system:

3. Install and configure VS Code

Install VS Code

We will use Microsoft Visual Studio Code (aka VS Code) as our integrated development environment (IDE) this semester. VS Code is a powerful, free code editor that runs in the macOS, Windows, and Linux operating systems. To install VS Code, please follow the directions for your machine:

Should you require assistance installing VS Code, please visit us during office hours during the first week of class so we can help get you up and running before our first machine problem (MP) is released.

Open VS Code

The next steps will be completed within the VS Code application.

Install the required VS Code extensions

There are various extensions that we need you to install in VS Code. Please install the following extensions by navigating to their respective page(s) in the VS Code Marketplace, and clicking the green "Install" button located near the top of the page.

Trouble installing an extension? Click here!

Disable Restore Windows in VS Code

  1. Open Settings
    • Mac / Linux: + ,
    • Windows: Ctrl + ,
  2. In the search box type restore windows.
  3. Set Restore Windows to None (via the drop-down list).

Connect VS Code to GitHub

To access the private repositories containing the starter code distributed in this course, you must log in to GitHub from within VS Code. Please follow along with the video below to connect your VS Code with your GitHub account. The link used in the video to acquire your private repository of the code is available through classroom.github.com/a/_TjBl-4m.

4. Install Docker Desktop

We will use Docker Desktop this semester to run the CS 128 containerized development environment. To install Docker Desktop, please follow the directions for your machine:

Should you require assistance installing Docker Desktop, please visit us during office hours during the first week of class so we can help get you up and running before our first machine problem (MP) is released.

5. Login to Docker Hub via Docker Desktop

To pull our the image for our development environment, you will need to:

6. Connecting to, and working inside of, the development environment

Now that we've set things up, it's time to introduce how to connect to the CS 128 development environment and author your solutions to programming problems. Please carefully watch the video that follows. You can access the assignment (you previously accepted) to complete the setup at classroom.github.com/a/_TjBl-4m as directed in the video.

What if I don't see the open in dev container popup?

If the popup asking whether you want to open the folder in the dev container does not show up, you should:

  1. Open the "Command Palette" (Ctrl Shift P for Windows/Linux or Command Shift P for Mac),
  2. type "Dev Containers: Reopen in Container", and
  3. select to execute that command (click it!).

7. Using the environment with your own projects

To use the development environment you just configured with your own personal projects, you'll need to start with the CS 128 environment dotfiles available at github.com/cs128-illinois/env-dotfiles.

This repository serves as your essential starting point for any new project where you want to use the CS 128 development container. It contains all the necessary configurations to properly integrate the development environment you just set up with your personal projects.

Important: You will need one copy of these dotfiles for every project you'd like to use the development environment with. Each project should have its own copy of the configuration files.

The dotfiles repository includes:

To set up a new personal project with the development environment:

  1. Clone or download the dotfiles repository and rename for your project: git clone https://github.com/cs128-illinois/env-dotfiles.git .
  2. Open the project in VS Code and reopen in the development container

For debugging support: To use the visual debugger with your personal projects, ensure your compiled executable is named exec and placed inside a directory called bin at your project's root (i.e., bin/exec). This naming convention is required for the debugger configuration to work properly.