CS 70

Building Programs from Multiple Files

The goal of this lab is to get some experience working with multifile compilation (starting with Homework 3, all future assignments will involve multiple files!)

The Task

Get together with your partner and clone this GitHub repository.

In this repository, you will find the files allcaps.cpp, allcaps.hpp, exclaim.cpp, exclaim.hpp, and shout.cpp. Together they can be used to create a program...but right now, they are missing some of the "glue" needed for them to work together! Your job is to fix the code and build the program.

Specifically, you will need to:

  • Figure out how the files depend on each other, and which one contains the main function.
  • Add missing #include directives to the files so that each file includes the header files it needs (but try not to add more #include lines than needed!).
  • Compile the files into object files.
  • Link the object files into an executable.
  • Run the executable to see what it does.

Please also briefly answer the following questions:

List all the #include directives you added, and which files you added them in.

Paste the command you used to compile the files into object files:

Paste the command you used to link the object files into an executable:

When you've finished, you can either work on finishing Homework 2 or start on Homework 3.

(When logged in, completion status appears here.)