Using Gnu g++ with "Computing Concepts with C++ Essentials"

Installation

  1. The files are delivered in tar format. Place ccc.tar in your home directory. Check that it is there:
    cd ~
    ls -alg ccc.tar
    You should see the directory listing for the tar file.
  2. Extract the files.
    tar xvf ccc.tar

Console programs

  1. To compile a file, use the following command:
    g++ -I~/cccfiles -g -e myprog myprog.cpp -lm
    Pay careful attention to letter case and spaces.
  2. To run the program, type its name without an extension.
    myprog

Graphical programs

  1. To compile a file, use the following command:
    g++ -I~/cccfiles -g -e myprog myprog.cpp -L/usr/X11/lib -lX11 -lm
    Pay careful attention to letter case and spaces.
  2. To run the program, type its name without an extension followed by an ampersand.
    myprog &

Known Problems