-
“KatrinBistreck” authored“KatrinBistreck” authored
title: Setup Windows Environment
summary: How to create the C++ build environment on Windows
authors:
- Sebastian Oberschwendtner
date: 2024-03-01
Introduction
We recommend to use the Windows compiler for the best experience and to create programs which are easily distributable to other Windows machines. The tools used are:
- Compiler:
Clang
orMSVC
- Generator tool:
CMake
(more infos here) - Package manager:
vcpkg
- some other tools (Python, Git - see below)
You can use Visual Studio Code as your IDE which will integrate everything, but since we are not prescribing any IDE, this will only show you how to setup the build tools.
☝️
Install Git
- Download and Install the latest release of Git: Download Git :octicons-link-external-16:{:target="_blank"}
- Enable the option to make Git available in PATH.
- Leave the rest of the options to their defaults.
Install Python
- Download and install Python: Download Python :octicons-link-external-16:{:target="_blank"}
!!! warning Please install version 3.11.8, select all the default options and check the option to add Python to PATH & make sure to include the debug binaries!
Python Dependencies
The only Python dependency we have is pipenv
which is used to manage the Python environment.
Install it by executing the following command in a terminal after you have successfully installed Python:
pip install pipenv
Install CMake
- Download and Install the latest release of CMake: Download CMake :octicons-link-external-16:{:target="_blank"}
!!! important Install at least version 3.29!
- Enable the option to make CMake available in PATH.
Install VS Code (optional)
If you'd like to use VS Code as your IDE and haven't installed it yet, now it's the right time for it
Install Build Tools
- Download the build tools from Microsoft: Download Build Tools :octicons-link-external-16:{:target="_blank"}
The page should look something like this:
- Execute the installer and install at least these components:
- Desktop development with C++
- C++ CMake tools for Windows
- C++ Clang tools for Windows (⇒ This will include the Clang compiler as well.)
!!! attention The latest version of Visual Studio Build Tools can change throughout time. Just download the latest one and keep a note which version that is.
Install vcpkg
vcpkg is the open-source package manager maintained by Microsoft we use to install and manage our dependencies.
-
vcpkg recommends to keep the path where you install it short, so create the following folder:
:octicons-file-directory-16:
C:\dev
!!! warning From now on we assume, that you installed vcpkg in this folder!
- Open a terminal inside
C:\dev
- Clone the vcpkg repository:
git clone https://github.com/microsoft/vcpkg.git
- Create the vcpkg executable by executing this command in the opened terminal:
.\vcpkg\bootstrap-vcpkg.bat
You can get more information how vcpkg can be installed in the Readme :octicons-link-external-16:{:target="_blank"} of the project itself.