Create a cpp project with Eclipse Cpp Oxygen

This article will show you the steps you need to begin a c plus plus project with Eclipse Cpp Oxygen. If you have not installed Eclipse Cpp Oxygen yet then you will need to head over to eclipse’s download page and start to download the eclipse oxygen installer then use it to install eclipse cpp oxygen on your pc.

Once you have installed Eclipse Cpp Oxygen on your computer, start eclipse as usual then create a folder as the workspace and pointing the path of the eclipse workspace to that folder you have just created on the computer hard drive. Now you can start the first project by File->New->C++ Project, provide a name for the project and select the below setting. It is recommend to use the existing Hello World C++ Project template for all of your projects instead of starting with an empty project, you can modify the content of the hello world project later on which includes changing the name of the cpp file.

Create the following setting
Create the following setting

Press the Next button and fill in the author name, copyright notice, you can even change the text which will be printed on the console like so…

Fill in all the details
Fill in all the details

Press the Next button again and again…

You will need to fill in the Cross Compiler Path which is the path to the MinGW compiler which is inside the MinGW/bin folder, when you install the Eclipse Cpp Oxygen MinGW compiler will get automatically installed by default on the C drive.

The path to the compiler
The path to the compiler

Click Finish and the project has been set up! Below is what appears on the eclipse’s editor.

The first c++ program
The first c++ program

You do need to fill in the version of the file yourself.

On the Project Explorer pane you can see the below project folder tree

Hello World project folder tree
Hello World project folder tree

Next you need to build the configuration first before you can run your program, goto Project->Build All and you are now ready to run the project. Notice that a new debug folder has been created with the HelloWorld.exe binary in it, this binary is the one which will get called later on!

Next click on the green arrow run button on top of the code editor and from the drop down list select Run Configurations, a panel will appear, at the left pane of the Main tab select C/C++ Application then right click and select New to create the debug form. Fill in the path to the exe file under the C/C++ Application’s text input field, in this example the path will be, Debug/HelloWorld.exe, click the Apply button and then click on the Run button.

Do the below setting
Do the below setting

When you see the below pop up, do the following setting

select the HelloWorld.cpp file to launch
select the HelloWorld.cpp file to launch this program

Click the OK button to launch the console application. That is it!

The text appears in the console
The text appears in the console

Once the setup is completed, the next time you changed or updated the program all you ever need is just to click on the green Run button and the project will be built automatically. If you want to make sure then you can go to the Project tab and make sure the Build Automatically checkbox has been selected!

Look at the Project Explorer window again and see the new folder tree with the newly created Debug folder!

Project Explorer Window
Project Explorer Window

I hope you do enjoy this tutorial, it is not so short because we do need to do lots of set up before we can run even a simple program, hopefully the eclipse team will improve on the coming version of eclipse cpp to reduce the steps need for the set up process!

Leave a Reply

avatar
  Subscribe  
Notify of