To run any c program you firstly need a compiler that can compile your program and execute it after compilation. So for c programming, we also need a compiler and its installation is very simple. Therefore, in this article let’s discuss how can we install a C compiler on your Windows 10 machine.
Video Tutorial: How To Install C Compiler in Windows 10
If you’re still finding it hard to install a C compiler on Windows 10 machine then you can refer to the below video for a complete guide.
Step 1: Download MinGW Compiler for Windows 10
1) Firstly we will download the C compiler for our windows machine and for that we’re going to download the “MinGW” compiler. Follow the download link provided below you’ll be redirected official site of MinGW.
Download MinGW Compiler Here: https://nuwen.net/mingw
2) We will download the self extractable archive for MinGW to make our installation process easy and simple. So simply click on the “MinGW-17.1-without-git.exe” and your download will start.
Step 2: Extract MinGW in Windows 10
1) Once your download gets finished open it from the folder where it has been downloaded and double click on it to start the installation process.
2) Now you’ll be asked to choose the extraction location of the compiler, in the text field type “C:\” and click on the extract button. Extraction of this archive will take some time so keep patience.
Step 3: Setup Environment Variables in Windows 10
1) Next, we will set up the environment variables for accessing GCC in vs code, and to do so, first copy the location of the bin folder from the newly extracted MinGW directory. In our case, it looks like this: “C:\MinGw\bin“.
2) Now, open up the properties of your windows machine and click on the advanced settings button.
3) Click on the environment variable button.
4) Now, select the path variable by simply clicking on it.
5) Click on the edit button to add the environment variables.
6) Now click on the “New” button and paste the location we’ve copied from step 1.5 in this blank field and click ok.
Step 4: Verify GCC Version
1) Open Up the command prompt, type
gcc –-version and press enter.
If you’re able to get similar output to the above image then congrats you’ve successfully installed MinGW C Compiler in your windows 10.