Tools

There’s no better way to understand programming than to write code! There are lots of different ways you can practice writing C++… there is no excuse for not trying.

Online: cpp.sh

If you just want to write some quick C++ to see what it does (an excellent habit to get into!), you might find cpp.sh helpful. It doesn’t require any software to be installed on your computer other than a Web browser: you can even use it from a phone, tablet, etc.

Windows

  1. Install Java and the GNU C++ compiler using my installation script.
    • this may take a while to run
    • if SmartScreen blocks the script, click “More info”, then “Run anyway”
  2. Download and run the new Eclipse installer, choosing “for C/C++ Developers” when prompted.
  3. Make sure that you log out and back in again before attempting to run Eclipse.
  4. When you create a new C++ project in Eclipse, choose “MinGW GCC” as your compiler: Creating a new project in Eclipse Selecting MinGW GCC in the New Project window

Mac OS X

First, install XCode from the App Store . This is, in fact, a great environment for writing C/C++ code, so you can stop here if you like! If, however, you want to have the same environment set up as in the lab, you can install Eclipse:

  1. Install the latest Java Development Kit (JDK)
  2. Install Eclipse
    • Visit the Eclipse downloads page
    • Download the 64-bit version of Eclipse
    • Open the downloaded file and drag the Eclipse folder to Applications
  3. When you create a new C++ project in Eclipse, choose “MacOSX GCC” as your compiler: Creating a new project on MacOS

Note: to run the Teaching Machine, you may also need to install an older (“legacy”) Java virtual machine.

Other operating systems:

On POSIX operating systems (FreeBSD, Linux, etc.), installation should be much simpler. Just install the appropriate package:

Fedora yum install eclipse-cdt
FreeBSD pkg install eclipse-cdt
Ubuntu apt-get install eclipse-cdt