Getting up and running



Want to start writing C++ programs on a Raspberry Pi? If you have Debian or Raspbian as your operating system, then you already have the GNU Compiler Collection installed. This contains the g++ compiler,  the program need to compile C++ source-code and to create an executable machine-code program.


Raspbian users also have the Geany text-editor installed. You can use Geany to create your C++ source-code programs. Simple programs should be saved with a filename that ends in ".cpp".



Once saved, you can then build your program. The g++ compiler will take your C++ source code and translate it into low-level code to create an executable program. Once created, you can run this executable.










If there is a problem with your code, Geany will display any warnings or error messages, helping you to find the where the problem is.

If you are using Debian as the operating system for your Pi, you may need to install Geany yourself. From a terminal window, try:

    sudo apt-get update
    sudo apt-get install geany


Not got a Raspberry Pi? You can still use the same tools to create C++ programs on any PC that uses Ubuntu Linux, or even on an Apple Macintosh running MacOS X.

On an Ubuntu PC, to install the GNU Compiler Collection, try:

    sudo apt-get update
    sudo apt-get install build-essential