To create an executable program, several .obj files must be linked together. The implementation of the date class must be part of the final executable program as must the implementation of the string class and the iostream classes. To create an executable program called calendar.exe several object files must be combined or linked together. These files are date.obj , the object code that is the implementation of the date class and apstring.obj if you're using the AP string class. In most programming environments, the iostream classes and other support classes have .obj files that are combined into a library , which is a file that combines several .obj files into one file.
Libraries typically have .lib suffixes.
The process of including, compiling, and linking are illustrated in the following diagram. A library file named xxx.lib is shown being linked with the object code for the classes and program that are combined to generate an executable named calendar.exe . Note how some header files are included in each of the .cpp files. For example, the Date class, whose interface is given in date.h , uses the string class for some of its functions. Using Projects One way to ensure that all the right code is compiled and linked is to put all the .cpp files that have code your program needs into a project.