Installing a C++ IDE on Your Own PC

Steven J. Zeil

Last modified: May 20, 2017
Contents:

This document will walk you through the process of installing an IDE (Integrated Development Environment) on your PC that will help you to work with a C++ compiler.

This document assumes that you have made either

  1. Already installed a C++ compiler on your PC, and added it to your executable PATH on your PC, or
  2. Are using a Windows PC and have decided that you want to install the Code::Blocks package that already includes a compiler. Refer here for a discussion of the options available to you.

1 Which IDE do You Want?

There are two main choices:

  1. Code::Blocks is the IDE we have been using for our beginning courses for several years. Most students start with this, as it is a bit easier to use and easier to install.

  2. Eclipse is a more professional-level IDE that offers better support for more advanced programming, larger projects, and for multiple programming languages.

    I use Eclipse on a daily basis, both for programming and other development tasks, including managing the documents that make up this course website.

The labs in CS 150, 250, & 333 are generally designed to be done in Code::Blocks. You may be able to use Eclipse for your work in those courses, but you will need to assume the responsibility of translating the activities you learn in the labs from Code::Blocks steps to the equivalent Eclipse steps.

So, make your choice, and jump to either Installing Code::Blocks or Installing Eclipse.

2 Installing Code::Blocks

  1. Go to the Code::Blocks site and click “Downloads”, then “Binaries”.

Choose the appropriate binary for your PC operating system and download it.

If you are on Windows,

Run the installer that you have just downloaded and follow its instructions to install it.

2.1.1 Try It Out

The next time you run Code::Blocks, it should find your C++ compiler. (That’s why we added it to your PATH.)

Go through some of your old C++ projects from your earlier courses, if you have any. Pick one that involves two or more .cpp files and at least one .h file. Prove that your installation works by compiling and running that code.

3 Installing Eclipse

3.1 Install Java

Eclipse itself runs in Java, so you need to have a reasonably up-to-date version of Java on your PC.

3.1.1 If you are on a Linux PC

Most Linux distributions will support installing Java as part of their normal software installation process. Do what you normally do to install any new software package.

3.1.2 If you are on a Windows or OS/X PC

There are two main Java packages.

Either way, just download the installer for your PC’s operating system and run it.

3.1.3 Try It Out

The first time you run Code::Blocks, it should find your C++ compiler. (That’s why we added it to your PATH.)

Go through some of your old C++ projects, if you have any, from your earlier courses. Pick one that involves two or more .cpp files and at least one .h file. Prove that your installation works by compiling and running that code.

Alternatively, move forward to Creating a New Project in Your IDE.

3.2 Install Eclipse

Get Eclipse for your platform from the Eclipse Foundation.

(If you are on a Linux PC, you may find that Eclipse is also available via your normal software package installation method. I recommend ignoring that and following the instructions below so that you 1) get the latest version, and 2) get the right mix of optional packages that you need.)

As of this writing, you want “Eclipse Neon”. But there are two ways to go, here.

  1. If all that you are interested in is C++, click the link under the Download button that says “Download Packages”. Scroll down to the “Eclipse IDE for C/C++ Developers” and download the appropriate installer for your PC’s operating system.

  2. If you want to reserve the possibility of doing Java programming in Eclipse in the future, use the Download button to get the “default” Eclipse package.

Run the installer and follow its directions to install Eclipse.

3.2.1 If You Installed the Default Eclipse

If you installed the default Eclipse rather than the C/C++ Developer’s version, we need to add the C++ support.

From the Eclipse Help menu, select Install new software.... Search “All Available Sites” for “C++” (Note, the search is really slow. Be patient.) or scroll down to “Programming Languages”.

Select:

If you are on an OS/X PC, you should also select:

Follow the on-screen instructions to install these selected packages.

3.2.2 Try It Out

The next time you run Eclipse, it should find your C++ compiler. (That’s why we added it to your PATH.)

Go through some of your old C++ projects, if you have any, from your earlier courses. Pick one that involves two or more .cpp files and at least one .h file. Prove that your installation works by compiling and running that code.

Alternatively, move forward to Creating a New Project in Your IDE.