dev_tool_tutorials

Tutorials on common developer tools for computer science students.


Project maintained by jeremyglebe Hosted on GitHub Pages — Theme by mattgraham

C++ Dev Environment With VSCode & Windows

Subject

Setting up a development environment in Windows can be difficult. Still, there are advantages to setting up your own dev envrionment v. installing overbloated IDEs. In this tutorial, we will discuss how to set up a general dev-environment for C++ on Windows using Visual Studio Code. We will be using the G++ compiler. As an added bonus, we will go over installing Git and managing your GitHub repo through vscode.

Requirements

The following is assumed about your environment:

Install VSCode

Install MinGW-W64

MinGW is a package of GNU elements for developers on Windows. If that last sentence didn’t make sense, don’t worry its not important. What is important is that MinGW comes with the option to install the G++ compiler. This is the compiler of choice for many c++ developers and the one we will be using. (Note: MinGW-W64 is a newer, actively maintained version of MinGW. This tutorial was originally written for MinGW but MinGW-W64 has wider compatibility and easier installation.)

Add extension “Code Runner” to VSCode

The Code Runner extension is a quick and convienent method of executing your code inside of VSCode. It works for numerous languages, including c++. Of course, you have MinGW installed and G++, so you don’t need code runner. But I highly recommend it.

Install Git

Git is a useful tool for project management, version control, and collaboration. Regardless of whether you intend to use websites like GitHub, Git can still be a useful tool for your development environment. It also comes with a Bash terminal which has many features not present in Windows Command Line. Unless you are absolutely sure you don’t want to use Git, and have an alternative set up, you should follow these steps.

How to Manage GitHub Repo with VSCode

This is an extra section for developers who want to use VSCode to manage their code repository on GitHub. I assume that you 1) have a GitHub account and 2) have created and can navigate to your repository. Everything else should be covered below.