Your first C++ Application Tutorial (Eclipse Under Windows™)

eclipse_bckgr_logo_fc_lg

 

Download Toolchain

Eclipse IDE for C/C++ Developers does not contain a compiler or debugger.
You can download many types of toolchains
I’ll demonstrate using MinGW.

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

 

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.