Lab 4 - Seperate Compilation

The purpose of this lab is to learn how to create multiple files for the purposes of seperate compilation. The lab will begin with a brief lecture on Ch 13.5 at 12:20, describing seperate compilation syntax. Then you will practice the technique by converting Lab 3 to use separate compilation.

Lab Assignment

Take the solution from Lab 3 and break it into three seperate files: Be sure to put the #define segment in the header file as outlined in Ch 13.5 (I will show you how to do this during the lecture portion of the lab).

Compile each portion of your seperated code with the following commands:

g++ -g -c score.cpp
g++ -g -c main.cpp
You should now have the object files score.o and main.o. These are not quite yet ready to be run as an executable. To do so, you need to link the two files using the following command:
g++ -g -o lab4 score.o main.o
You should now have an executable called lab4 that you can run with ./lab4 as you would any other executable.

Turn in your score.h, score.cpp and main.cpp files by attaching all three to the email.