Build Your First C++ App with Eclipse on Windows

Build Your First C++ App with Eclipse on Windows

eclipse_bckgr_logo_fc_lg

 

A beginner tutorial for setting up a C++ development environment on Windows using Eclipse IDE and MinGW, and building your first Hello World application.

Download Toolchain

MinGW can be installed Automatically or Manually. I’ll stick for now with manual for the purpose of this tutorial.

mingwinst

  • Download and run the latest mingw-get-inst version.
  • Select the directory to install MinGW, remembering the advice given above that the path to this directory should not contain any spaces.
  • Don’t forget to add the C++ Compiler and If you need others. Select the optional components to be installed, including the C++, Fortran, Objective-C, and Ada compilers and MSYS. mingwc++

 

Wait GUI installer to download and run the mingw-get CLI installer to install GCC. Note that make and gdb are installed automatically by the GUI installer.

Add C:\MinGW\bin; (or wherever else you’ve installed to) to the PATH environment variable by:

  • System control panel -> Advanced tab -> Environment Variables

 

Download IDE

Download the eclipse IDE for C/C++ Developer here. Unzip eclipse to any place you’d like. (Windows™ users, see this note).

 

New Project

Start Eclipse. Start a new C++ Program:

File -> New -> C++ Application

ecliposenewc++

 

Give your app whatever name you’d like; For project type choose: Executable -> Hello World C++ Project and toolchain (MinGW GCC) and click Finish.

eclipse-c++-explorer

 

Your new project opens in Eclipse. you can:

  • Project -> Build All eclipse-c++-build

 

and then click the play button or:

  • Run -> Run eclipse-c++-run2 eclipse-c++-run

To see your first hello world c++ application in action!

Watch the Eclipse console for the results ;)

eclipse-c++-console