How to Write and Run Your First C Program in Eclipse IDE
If you’re ready to start coding in C using Eclipse IDE, this beginner-friendly tutorial will guide you through the process step by step. In just a few minutes, you’ll learn how to create a basic C project, compile it, and run your first program successfully.
By the end of this guide, your first C program will be up and running — giving you a solid starting point for deeper learning.
About This Tutorial
Welcome to the PicoBit-Tech channel.
My name is Behnam Jafari, and in this session, I demonstrate how to write and execute your first C program using Eclipse IDE.
This tutorial is ideal for learners who have already installed:
-
MinGW (GCC compiler for Windows)
-
Eclipse IDE for C/C++
If you have not installed these tools yet, you can find step-by-step installation guides linked at the top of this page.
Step-by-Step Project Creation in Eclipse
1️⃣ Launch Eclipse
When Eclipse starts, you will be prompted to choose a workspace directory.
If you check the option to use this as the default workspace, the dialog will not appear in future launches.
2️⃣ Create a New C Project
-
Go to File → New → Project
-
Select C Project
-
Click Next
Under Executable, choose:
-
Hello World ANSI C Project
Under Toolchains, select:
-
MinGW GCC
Enter your desired Project Name, then click Next.
3️⃣ Configure Project Details
-
Author: Displays project creator information
-
Hello World Greeting: Customize the message printed in the console
-
Source Folder: Default location for source files (no changes required)
Click Next, then Finish.
4️⃣ Edit and Build the Program
-
Open the project and locate the main file inside the src folder
-
Make any necessary modifications
-
Save the file
-
Click Build to compile the project
Ensure there are no errors or warnings in the console output.
5️⃣ Run the Program
To execute the program:
-
Right-click the project
-
Select Profile Tools → Profile Configuration
-
Double-click C/C++ Application
-
Browse to the executable file inside the Debug folder
-
Click Apply and Close
-
Run the project
Your custom greeting message will now appear in the Eclipse console.
What You Achieve in This Tutorial
✔ Create your first C project
✔ Compile a C program using GCC
✔ Run and verify program output
✔ Understand the Eclipse project structure
This is the first practical step in mastering the C programming language and building a strong foundation for low-level development.