Answer

  1. First you need to compile each of the ``.c'' files separately. You can do this by using the -c option of the compiler from a Unix shell window:

    gcc -Wall -g -c main.c
    gcc -Wall -g -c help.c
  2. Next you need to link the two resulting ``.o'' files into a single executable program. You can do this by using the -o option of the compiler:

    gcc -o demo main.o help.o -lm

    This results in an executable called ``demo''.

  3. Finally you need to run the resulting executable. You do this by:

    demo

Return to lesson.