CISC 3142
Programming Paradigms in C++
Separate Compilation


Overview

Separate compilation is the ability to compile portions of code that in themselves do not form an entire program. These compiled elements can then later be combined with additional code to form a complete program. The motivations behind this facility are:

More on the Creation of an Executable Program

Getting your code from source to executable is known as translation. In a compiled language (such as C++), this process actually consists of two separate steps:

Source, Object and Executable Files

Where Types Fit In

The Preprocessor

Header Files and #include

Module Structure, Include Guards

Header file structure Implementation file structure

The Source File Containing the External Function Declaration

A Closer Look At g++

Code Used in this Lecture