(Optional) Installing a C++ IDE and Compiler on your own PC

Steven Zeil

Last modified: Aug 29, 2023
Contents:

1 Local Development

We have previously looked at options for developing code remotely, where the compiler and/or the IDE ran on a remote machine. Although that is a perfectly good option for most coursework, many students prefer to do local development, where the compiler and IDE reside on their own PC. Among other things, this allows students to work while offline.

Both Eclipse and VSCode can be easily installed on your own PC. Installing your own copy of a C++ compiler is slightly more complicated, but not terribly so.

Advantages:

Disadvantages:

This information on local development is provided as a convenience for students wanting to explore other options. For the assignments in CS252, you must use one of the remote compiling options we have covered in the earlier lessons.

All of the configurations I discuss below can be set up free of charge.

1.1 For students with Windows PCs

There are two sources I recommend for the C++ compiler and toolset.

  1. The Windows Subsystem for Linux (WSL) is a Microsoft official product, a Linux virtual machine that runs, pretty much seamlessly, on a Windows 10 machine. It pairs nicely with VSCode, which treats it like it was simply a remote Linux machine.

    • Toolset: Linux g++, gdb, make, git
    • IDE: VSCode

    Installation instructions are here.

  2. Cygwin is a Unix (technically, POSIX) emulator layer that runs in Windows 11 and older Windows operating systems. It can pair with either Eclipse or VSCode.

    • Toolset: CygWin g++, gdb, make, git
    • IDE: Eclipse or VSCode

You might notice that I do not recommend any configuration based on Code::Blocks, which you may be familiar with from your beginning programming classes. There are good reasons for this. It will be common in more advanced programming projects to have more than one executable program produced in a single project, and Code::Blocks does not cope well with such projects. Additionally, the MinGW compiler favored by Code::Blocks is not easily extended by the addition of pre-compiled code libraries, another common feature of more advanced projects.

1.2 For students with MacOS PCs

For MacOS PCs, you will use the clang compiler rather than GNU g++. The two compilers share a lot of the same “front-end” code, however, so you will usually find they behave very similarly, even issuing identical error messages when encountering compilation errors.

* Toolset: clang c++, ilb, make, coreutils
* IDE: VSCode 

Installation instructions are here.