Getting Started¶
Note
This guide is for new users unfamiliar with the installation process.
Click here to skip the tutorial and jump to the overview.
Learn how to set up the development environment to start working with our projects!
Setting up the C/C++ Compiler¶
A compiler translates human-readable code into machine code. We will be setting up the C/C++ compiler so that our code written in the human-readable C++ language can be understood by the computers!
Open up the Command Prompt.
Tip
You can use the Windows Search Bar to find the Command Prompt application.
Use the Command Prompt to install Chocolatey by following the instructions here. Chocolatey is a package manager that simplifies the installation of the tools we will need.
We will now install the compiler and other build tools using Chocolatey. In the Command Prompt, enter the following commands:
choco install -y cmake --installargs '"ADD_CMAKE_TO_PATH=System"'
choco install -y ninja
choco install -y llvm
refreshenv
Note
The above command will make cmake
available to all users on the Windows machine. To only set it for the current user, replace System
with User
.
Next, we want to check that the tools were properly installed. Enter the following commands:
cmake --version
ninja --version
clang --version
cmake version 3.25.2
1.11.1
clang version 15.0.7
Help
If any of the above commands returned an error, it is possible that the PATH
environment variable is not properly set.
Search for “Edit the system environment variables” in the Window’s search bar and select the option that appears.
Tip
You can also access the Environment Variables window from "Control Panel → System and Security → System → Advanced system settings".
Double-click on “Path” under “System variables”.
In the “Edit environment variable” window, check that paths to the installed tools are set as in the picture below.
If not, click on “New” to add the missing values.
Note
ninja
is installed under C:\ProgramData\chocolatey\bin
Install cmake
, ninja
, clang
and other development dependencies using the package manager of your favorite distribution.
For example on Ubuntu, you can use the following commands:
sudo apt install build-essential cmake ninja-build clang xorg-dev libdbus-1-dev libssl-dev mesa-utils
Rust¶
Rust is another programming language that we will be using. Install it from here.
Open up the Command Prompt.
Tip
You can use the Windows Search Bar to find the Command Prompt application.
Help
You can check if Rust is properly installed by using cargo --version
in the Command Prompt.
If a version number is printed, your installation was successful!
cargo --version
We will be using the nightly version of Rust which is updated more frequently compared to the stable and beta versions. Install it with the following commands:
rustup toolchain install nightly
rustup +nightly target add x86_64-pc-windows-msvc
rustup default nightly-x86_64-pc-windows-msvc
Help
You can check if Rust is properly installed by using cargo --version
in the Command Prompt.
If a version number is printed, your installation was successful!
cargo --version
We will be using the nightly version of Rust which is updated more frequently compared to the stable and beta versions. Install it with the following commands:
rustup toolchain install nightly
rustup +nightly target add x86_64-unknown-linux-gnu
rustup default nightly-x86_64-unknown-linux-gnu
To add support for building to web browsers, input the following command:
rustup +nightly target add wasm32-unknown-unknown
Use the rustup update
command to update your installation. Since we are using the nightly release, you are encouraged to update often.
rustup update
Git & GitHub¶
Git is a system used for managing and tracking changes in your code. It is also known as a Version Control System (VCS). It makes it easier for collaborators to work together, and allows you to access our projects too!
Install Git here. The installation settings can be left unchanged.
Alternatively, you can also use chocolatey:
choco install -y git
Install git with the following command:
sudo apt install git
Although Git is powerful, it can be daunting to use on its own. Instead, we use GitHub, a service which employs Git’s version control with its own to make project collaboration much easier.
We recommend that you use a Git GUI Client to facilitate your work by pruning off the manual input of code and making the version control process more visual.
We will be using GitHub Desktop for the tutorials. You can install it with the default settings, and create a GitHub account when prompted if you do not have one.
Alternatively, you can also use chocolatey:
choco install -y github-desktop
Note
Even though we recommend GitHub Desktop, feel free to use any GUI client of your choice!
Code Editor¶
A code editor allows you to work with code more easily. We will be using Visual Studio Code (VS Code) for this tutorial.
You can download it here, and install it with the default settings.
Alternatively, you can also use chocolatey:
choco install -y vscode
VS Code is available as a snap package, which can be installed with the following command:
sudo snap install --classic code
Note
Follow the installation page for more details, and for other installation alternatives.
Note
You are free to use any code editor of your choice, although you will have to complete steps of this tutorial through alternate means.
VS Code Extensions¶
Launch Visual Studio Code and open the Extensions view (Ctrl+Shift+X). We will be installing a few extensions to facilitate our VS Code experience.
Search for and install the following extensions:
-
C/C++
-
rust-analyzer
-
CodeLLDB
-
Better TOML
-
Calva
-
CMake Tools
-
YAML
Overview¶
-
Install Chocolatey.
-
Install
cmake
,ninja
andllvm
using Chocolatey.choco install -y cmake --installargs '"ADD_CMAKE_TO_PATH=System"' choco install -y ninja choco install -y llvm refreshenv
-
Install Rust.
-
Install and set up the Rust nightly build.
rustup toolchain install nightly rustup +nightly target add x86_64-pc-windows-msvc rustup default nightly-x86_64-pc-windows-msvc
-
Install the Rust Web Assembly toolchain.
rustup +nightly target add wasm32-unknown-unknown
-
Update Rust.
rustup update
-
Install Git.
choco install -y git
-
Install GitHub for Desktop or any other Git GUI Client.
choco install -y github-desktop
-
Install the VS Code Editor.
choco install -y vscode
-
Install Extensions for Visual Studio Code.
-
Install
cmake
,ninja
,clang
and other development dependencies.sudo apt install build-essential cmake ninja-build clang xorg-dev libdbus-1-dev libssl-dev mesa-utils
-
Install Rust.
-
Install and set up the Rust nightly build.
rustup toolchain install nightly rustup +nightly target add x86_64-unknown-linux-gnu rustup default nightly-x86_64-unknown-linux-gnu
-
Install the Rust Web Assembly toolchain.
rustup +nightly target add wasm32-unknown-unknown
-
Update Rust.
rustup update
-
Install Git.
sudo apt install git
-
Install the VS Code Editor.
sudo snap install --classic code
-
Install Extensions for Visual Studio Code.