← Previous lessonFree lesson 3 of 3 · lesson 3 of 68

Unlock all 68 lessons of Embedded Programming EssentialsFull course ₹40,000 · paid

Price & syllabus
Free lesson · 15 min · no payment

Installing MinGW GCC and Running a First C Program

A free lesson from Skill-Lync's Embedded Programming Essentials course, on Grow by Skill-Lync · Last updated 16 Nov 2026 · Session: “W1 S1 Part 2 Compiler Installation and Creating New Project”

What will you learn in this free Embedded Programming Essentials lesson?

This lesson shows installing MinGW-64 on Windows, choosing the x86_64 architecture and the GCC, C++ and GDB packages. The instructor adds the folder to the system path, checks versions in a command window, then creates a project and runs Hello World.

  • Downloading the MinGW-64 Windows build
  • Selecting GCC, G++ and GDB packages
  • Adding the compiler folder to the system path
  • Building and running as a local C application

What comes after lesson 3?

Later in Skill-Lync's Embedded Programming Essentials course (paid): lesson 4, W1 S3 C Datatypes,FPU,Enum & Typedef; lesson 5, W1 S4 Operator Precedence & Associativity; lesson 6, Week 2 Session 1. The full course has 68 lessons (34 h 47 min of video); see the course overview or its price and syllabus.

Lesson transcript

Machine transcript of the lesson audio (lightly cleaned). Technical terms may contain errors; the video is the reference.

So, I'm going to copy this particular URL and put it here. Already it's there. So, it is the official MinGW64. Just look for Windows Build. So, and in the Windows Build, just go ahead and click this one. You'll be able to see the WinBuilds available for Windows. So, I have already downloaded it. Let me go straight away run the WinBuilds that we downloaded. So, it is going to take some time. So, once you have this WinBuild installation up, just go ahead and give that. Your system to install for should be SigWinRMSYS and your architecture to install for is X8664 in my case.

So, mostly everybody would be using some sort of X8664 architecture. So, go ahead and browse. So, you need to enter a folder where your necessary C files should get installed. Already in the C drive, I have created a folder named MinGW. I am just selecting it. If you don't have that, just go ahead and create it. Then, once this is selected, now all the necessary package required is going to get downloaded. And so, very importantly, we need to have these, all these tools is good to have.

Very importantly, you need to have GNU binary development tools, which will have all our GCC packages. And so, base GCC package with C support and C++ for GCC and GNU symbolic debugger. All these are very small in sizes. So, just go ahead and process all those. Even there could be 92 packages. It may take a while, not more than 10 minutes, depending on the speed of the internet, let it get downloaded. And once it got downloaded, it will be successfully installed in the folder that you have already selected.

Once all this downloaded happened successfully, it will proceed to install each of the package in the respective folder that we have selected. So, here you could see on the console window, you could see that GCC, GDB, the respective version installing is done. So, all these 92 packages will proceed to install. So, once you see that all the packages are installed, you could see this, all the state has been changed to key passes. So, just proceed to check whether they have been installed successfully. So, before that, you can go ahead and see the folder where you have mapped for installing it.

So, under min.gw, you will see opt created and you will see all the respective binaries. Just look for the GCC, GDB. So, you have GCC and G++, you have GDB. Just copy this link so that you can be able to add this in the path. Just to add the path, go for system advanced settings. Under system advanced settings, so just go ahead and edit this variable path. So, I have already mapped it. So, just to create a new one, click new and paste it. Since I have already added it, I am removing one.

Click OK. Now, to check this, whether it got properly installed, to check the version, just go for your command window and type for GCCI connection version. This is going to tell you what is the GCC version and just type GDB. This is going to get into you the GNO debugger. So, to come out of it, just execute it quit. So, this is how you can be able to successfully install the necessary GCC package for your host machine. So, once you have done the environment variable setting and you have done mapping all your GCC compiler, now let's go ahead and open the toolchain and we will go ahead and create our first project.

So, there are certain catches here when we are creating a new project. First, we need to create a workspace. Inside a workspace, our workspace is a place where you have collection of projects. So, inside workspace, you have to create a project and that project can be of any of this type. It could be if it is a C++ project. Other than that, you can go ahead and create STM projects as well. And very importantly, now we are going to write C programs which are going to be compiled for the host machine.

So, when you create your project type and you map your toolchain, please make sure that you are not choosing CROSS GCC or MCU HOM GCC. Rather, you have to choose MINCW GCC. So, that's the package which we have installed just now. So, once that is created, now then we can be able to directly write our first Hello World program and we will see how to execute and I will take you to the execution step and bringing up your first output. And we also will see and understand and spend some time in seeing the IDE layout.

So, here I have listed some of the steps that are really necessary to build a binary with our STM32 IDE with the GCC compiler. Now, let me show the real demo. I am about to open the STM32 IDE. It will take a while. So, the very first step is to create the workspace. So, already I have created a workspace. Workspace is nothing but a folder inside which we are going to have collection of projects. So, once I launch it, so my IDE is going to open with that particular workspace.

Now, let me close all the projects that I have. I will go ahead and delete. So, generally if you are opening it for the first time, you will have the information center popped out. And you have this window. The correct step or correct way for creating the project is just go to your file and create a new C or C++. Please don't choose STM or STM project or STM for a QMX configuration. So, just choose only C or C++ project. So, instead that you can choose C++ Manage Build.

Still, you can choose C Manage Build also. I am choosing C++ Manage Build. And give a project name. So, my first project, I am going to name it as first project. As I told you, very importantly, we need to choose our MinGW GCC as our toolchain. So, if not, we end up in cross-compiling our executable rather creating it for the host machine. Just go ahead and finish it. So, then you will see. So, this is your workspace. Inside your workspace, your first project is created. And now, inside your project, you need to add your C programs.

So, that I right click. I will go to new. And so, to create that, I am going to add a C source file. So, here, you need to give the file name. I am just creating it as HelloWorld. Very importantly, you need to give the extension as .c. Or else, it is not going to be created as a C file. Now, this is created. Just go ahead and type your first program. And we will also see how to compile and build this. I am going to write a simple HelloWorld program.

So, those who are completely new to C programming, let's not worry about what is actually getting in now. I will explain the layout and arrangement of the program in the upcoming slides. But the objective here is to understand the IDE and how to write a first program and run it. Simple HelloWorld. So, once you have written this, you can be able to save it by just by clicking this button or this button. And the two steps that is involved to see the output is, first, we have to build it.

Then, we have to run the executable. So, the building will... So, building will... The result in creating the executable for host machine and running it will help you to see the output in the console. So on back of this, there are some four-step process that's happening. So we'll discuss about that four-step process involved in the compilation process in our upcoming classes or in our upcoming lectures. So now let me go ahead and build the selected file. So you can do the build process in two steps, either by choosing the selected file.

Sometimes your project may have N number of C files and N number of user-added H files. And if you want to build only one selected file, you can do that. In our case, or at least in this example, we have only one C file per project. You can directly go ahead and build the entire project. So both are equivalently the same. So I'm going to run this particular command with passing this. So the result of this is going to be creation of object file. Once that is there up and linked with the library, you could be able to see the executable binaries created.

So this is my executable binary that got created. Now let me try running this. So to run this, again, there is a catch, very important catch here. Just right-click your project and try to run that application as local C or C++ application. Why? Because you are not creating an application for STM Cortex. Because you are creating an application as a C or C++ local application. So now it is going to show me the output here. So let, this is how you can able to execute your very first program.

Let me spend some time in explaining the layout of this IDE. So this part is called as your project explorer. This entire part is called as the project explorer. So this is your project explorer. So, which will have, or which will actually load the workspace. So your workspace is actually opened as a project explorer. Inside that workspace, you will see all the loaded projects, multiple projects. Inside the projects, you will see your source file and your created executable file. This part is called as your editor.

So editor is a place or it's a layout where we can edit our program, read and write your program. And this is our console. Console is a place where we see our standard output. All the standard output that we are streaming to the screen are displayed on the console. So this is a place where you can see the outline of the C program. So if your C program has 100 plus functions like this, all those 100 plus functions are listed here. You can jump from one function to other function.

And this is a place where we call it as the stack analyzer or the build analyzer. So this part we will discuss in the later phases of this course. So that's about the layout of this particular IDE, STM32. So there are multiple IDEs. For this course, you can use GCC with multiple IDEs such as code blocks. These are free IDEs and these are much sophisticated than STM32 IDE, which we are using. But there is a reason for the selection of STM32 due to its usage and continuation in the upcoming course.

So this STM32 is an Eclipse-based IDE. For that matter, you can use any Eclipse-based IDE. And you can use VS Code. VS Code is other popular IDE. So GCC is running at the backend. It's your toolchain. This is going to comprise your toolchain. And this could be your IDEs. Hope this is clear. And we are at our end of first session. So let's catch up in our second session. Thank you.

Want the rest of Embedded Programming Essentials?

Get the full course syllabus and fees.

The full course is paid (₹40,000). We'll send the syllabus and call you back within one working day.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Full course · paid

Unlock the full Embedded Programming Essentials course

The remaining 65 lessons, mentor-reviewed projects and a certificate come with the paid course (₹40,000). Leave your details: we'll send the syllabus and fees and call you back.

Get the syllabus and fees

A counsellor calls you back within one working day.

By submitting you agree to our Terms and Privacy Policy.

Grow by Skill-Lync · free lesson

Start watching

Free, no payment. Leave your details once and every free lesson on Grow plays straight away. A Skill-Lync counsellor may call you about the full Embedded Programming Essentials course.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.