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!)
Setup
Form a group of 3–4 people, and once you've formed your group, ask Prof. Melissa for a group number. Someone from the group should log into the CS 70 server on one of the lab computers.
Run:
cd /cs70/fall2026/lab/week03lab2/groupNN
where NN is your group number (e.g., group03 if you're group 3).
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.
The Task
You will need to:
- Figure out how the files depend on each other, and which one contains the
mainfunction. - Add missing
#includedirectives to the files so that each file includes the header files it needs (but try not to add more#includelines 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:
When you've finished, you can either work on finishing Homework 2 or start on Homework 3.
(When logged in, completion status appears here.)