# Installing Compiler (for Windows)

<details>

<summary>Authors</summary>

Li Chi Kin Andy

</details>

> Note: For the purposes of our tutorials you aren't required to install a compiler since for the most part we will be using STM32CubeIDE which comes with everything you need, and the tasks for tutorial 1 should be doable with an online IDE. However, we have seen cases where Windows users need to install a compiler on their own to make CubeIDE work properly, so this is here for reference. More info/instructions for Mac/Linux should be easily found on Google if you're into that.

Windows OS does not have any C/C++ compiler installed by default. This chapter teaches you how to install the MinGW C/C++ compiler. The whole process should take around **10-20 minutes**.

## Step 1

Go to this website <https://sourceforge.net/projects/mingw/> download the compiler

![](/files/DOU4qz9E0opNKThq1cWC)

## Step 2

2.1) Open the downloaded setup tool, press the Install and Continue button, and you will reach this interface.

![](/files/4ImNSjPtHg1ytdICENYV)

2.2) Select all packages by clicking 'Mark for Installation', go to Installation (at the top left corner), and click 'Apply Changes'.&#x20;

![](/files/a29N0oVakOW0jXAzY2Jt)

2.3) Start downloading packages

## Step 3

Copy the path of your Mingw to the environment variable

3.1) Search PATH in windows

3.2) Click on 'Edit the system environment variables', in Chinese,'編輯系統環境變數'.

![](/files/SbtJtMFE82PScv5navr0)

3.3) Add C:\MinGW\bin to PATH

![](/files/fVih1jBY3xSf8lPyxw3O)

## Step 4

To test whether the installation is successful, type `g++ --version` in the terminal to check.

![](/files/SImur5UkOSvXnEH0CS8m)

##

#### Congratulations 🎉🎉 you have successfully installed the MinGW C/C++ compiler!!

## Reference

<https://www.youtube.com/watch?v=FEeFG9OR-QU&ab_channel=GeekyScript>

&#x20;


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hkust-robotics-team.gitbook.io/hkust-robotics-team-software-tutorial/tutorial/tutorial-1-c-and-cubeide-setup/stm32cubeide-setup/stm32-cubeide-setup/installing-compiler-for-windows-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
