Boost C++ Libraries

PrevUpHomeNext

Chapter 4. Common tasks

Table of Contents

Programs
Libraries
Alias
Installing
Testing
Custom commands
Precompiled Headers
Generated headers
Cross-compilation

This section describes main targets types that Boost.Build supports out-of-the-box. Unless otherwise noted, all mentioned main target rules have the common signature, described in the section called “Declaring Targets”.

Programs

Programs are created using the exe rule, which follows the common syntax. For example:

exe hello : hello.cpp some_library.lib /some_project//library
          : <threading>multi
          ;

This will create an executable file from the sources—in this case, one C++ file, one library file present in the same directory, and another library that is created by Boost.Build. Generally, sources can include C and C++ files, object files and libraries. Boost.Build will automatically try to convert targets of other types.

Tip

On Windows, if an application uses shared libraries, and both the application and the libraries are built using Boost.Build, it is not possible to immediately run the application, because the PATH environment variable should include the path to the libraries. It means you have to either add the paths manually, or have the build place the application and the libraries into the same directory. See the section called “Installing”.


PrevUpHomeNext