Introduction to Building
This chapter contains recipes for transforming C++ source code into executable programs and libraries. By working through these recipes, you’ll learn about the basic tools used to build C++ applications, the various types of binary files involved in the build process, and the systems that have been developed to make building C++ applications manageable.
If you look at the titles of the recipes in this chapter, you might get the impression that I solve the same problems over and over again. You’d be right. That’s because there are many ways to build C++ applications, and while I can’t cover them all, I try to cover some of the most important methods. In the first dozen or so recipes, I show how to accomplish three fundamental tasks—building static libraries, building dynamic libraries, and building executables—using a variety of methods. The recipes are grouped by method: first, I look at building from the command line, then with the Boost build system (Boost.Build), and then with an Integrated Development Environment (IDE), and finally with GNU make.
Before you start reading recipes, be sure to read the following introductory sections. I’ll explain some basic terminology, provide an overview of the command-line tools, build systems and IDEs covered in the chapter, and introduce the source code examples.
Tip
Even if you’ll be using a build system or IDE, you should start by reading the recipes on building from the command line: these recipes introduce some essential ...