Contents

  1. Overview
  2. Text editor
  3. Compiler

Overview

This document will help you install a text editor to edit C++ programs, as well as a compiler. By the end, you should be all set up.

Text editor

The editor we will use on the Macs in the lab is Sublime Text 3. This is available for OSX as well as Windows. If you have OSX < 10.7, you probably will need to install Sublime Text 2. Sublime text, however, is not free. You can use the fully functional trial as long as you want, but it costs $75 to register.

There are many alternative. jEdit is a completely free, cross-platform editor. You may also wish to use a built in editor: Windows has Notepad, and Mac has TextEdit. In both cases, be sure that you are editing in the text format, not the rich text format.

Compiler

Choose your platform and install. You can test by opening Terminal (Mac) / PowerShell (Windows) and entering g++. If you get a warning that no files were provided, then you're all set! Otherwise, if you get an error about the command not being found, something went wrong...

Mac

If you already have XCode installed, you are done with this step. If not...

OSX 10.9 Mavericks

Go to Apple's developer download page and register if you haven't already—registration is free. Search for command line tools. Pick the most recent release for 10.9 Mavericks and install.

OSX 10.8 Mountain Lion or earlier

This project is for you as it will get you only the parts of XCode that you need for this. Download and install the package that matches your version of OSX (10.6 == "Snow Leopard", 10.7 == "Lion", 10.8 == "Mountain Lion").

Windows

The MinGW platform provides that and the other associated tools you need. Download the installer here.

Install MinGW/MSYS according to these instructions, though stop at Installing the IDE (we will use a different one). If you can't follow the "add to your path" part of the instructions, the following the directions below.

Setting your path

For Windows users, to change the PATH environment variable settings...

  1. Right click on "My Computer" and select properties:
  2. Click on "Advanced Settings" and from the "Advanced" tab click the Environment Variables button:
  3. In that popup window you want to edit the PATH system variable:
  4. At the beginning of the value, add value from the tutorial. Specifically:
    C:\MinGW\bin;C:\MinGW\msys\1.0\bin;

Great! Your path should be all set!!

(Back to top)