CUEH Development Environment Guides
Installing C++

Installing the C++ Toolset

As part of the programming module you study on the course, you will be tasked with using the C++ programming language to complete lab activities.

In this guide, you shall be taken through the journey of installing C++ for the Microsoft Windows operating system.

Downloading the Visual Studio Build Tools

Before you can begin using C++ for programming and providing solutions to lab activities and assignments, you will need to download the Microsoft Visual Studio Build Tools installer from the following link:

Microsoft Visual Studio Build Tools

Installing the C++ Build Tools

Once the Microsoft Visual Studio Build Tools executable file has been downloaded, you can proceed with installing the package on your Windows machine. During the installation process, you will want to ensure you select the following option Desktop development with C++. This will install all the necessary tools for C++.

With this option checked, you can click on the button labelled Download. This will begin the process of downloading the C++ build tools, and install them on your system.

Checking the C++ Installation

To confirm that everything is working as expected, you will need to perform a quick check using the command-line interface. To perform this check, open Developer Command Prompt for VS 2022 by searching for cmd in the Start Menu.

Important

It is very important you select the option with Developer Command Prompt for VS 2022. If you do not select this option, you cannot use the C++ toolset from the terminal window.

With the command-line interface open, you can type the command cl and the Microsoft C++ compiler should print the version number to the screen. It will be similar to the following output:

> cl
  Microsoft (R) C/C++ Optimizing Compiler Version 19.41.34120 for x86
  Copyright (C) Microsoft Corporation.  All rights reserved.

  usage: cl [ option... ] filename... [ /link linkoption... ]

Downloading CMake

The JetBrains CLion IDE requires CMake to build your source code into an executable file. As default, the Microsoft Windows operating system will not come with CMake pre-installed, requires installing a package downloaded from the internet. You will need to download the CMake installer from the following link:

CMake Installer File

You must select the version that is for the platform Windows x64 Installer.

Installing CMake

Once the CMake executable file has been downloaded, you can proceed with installing the package on your Windows machine. The default options recommended by the installer would suffice, as such you are not required to change any of the settings.

Checking the CMake Installation

To confirm that everything is working as expected, you will need to perform a quick check using the command-line interface. To perform this check, open Developer Command Prompt for VS 2022 by searching for cmd in the Start Menu.

Important

It is very important you select the option with Developer Command Prompt for VS 2022. If you do not select this option, you cannot use the C++ toolset from the terminal window.

With the command-line interface open, you can type the command cmake --version and the CMake tool should print the version number to the screen. It will be similar to the following output:

> cmake --version
  cmake version 3.30.4

  CMake suite maintained and supported by Kitware (kitware.com/cmake).

Conclusion

That is the end of this guide on installing the C++ toolset and if you have followed all the necessary steps correctly, you should have a fully functional implementation of the C++ compiler and build tools which will enable you to complete any necessary C++ programming-based activities and assignments you will participate with on this course.

Mistakes or Problems?

If you have spotted any errors or issues within this tutorial, you can e-mail Dr Ian Cornelius. Ensure to include in your message a description of the error or issue and a possible resolution. Also remember to include a URL to the page with the issue or error.