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.

If you’ve completed an assignment using cpp.sh and are looking for something to copy and paste your code into (for submission to Brightspace/D2L), you can use one of the following text editors:

Name Description macOS Windows Other

Atom

Free editor from the makers of GitHub

gedit

General-purpose text editor for open-source platforms

Notepad

Included with Windows (not to be confused with Wordpad)

Notepad++

Improved text editor for Windows

Sublime text

Beautiful and popular editor, but costs money

TextEdit

Included with macOS — click "Format > Make Plain Text"

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 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:

    image::eclipse-win-new-project.png[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 that you’ll see me using in class, you can install Eclipse:

  1. Install the latest Java Development Kit (JDK).

  2. Download and run the Eclipse installer, choosing "for C/C++ Developers" when prompted.

  3. When you create a new C++ project in Eclipse, choose "MacOSX GCC" as your compiler:

    image::new-project-macosx-gcc.png[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