1.23. Specifying a Runtime Library Variant
Problem
Your toolset comes with several variants of its runtime support libraries and you want to instruct your compiler and linker which variant to use.
Solution
Runtime libraries supplied with a given toolset can vary depending on whether they are single- or multithreaded, whether they are static or dynamic, and whether or not they were built with debugging information.
If you are using Boost.Build, these three choices can be specified using the threading, runtime-link,
and variant features, described in Table 1-15. For example, to specify a
statically linked runtime library, add <runtime-link>static to your target’s requirements, or use the
command-line option runtime-link=static. To specify a
multithreaded runtime library, add <threading>multi to your target’s requirements, or use the command-line
option threading=multi.
If you are building from the command line, use the compiler and linker options presented in Tables 1-30 through 1-36. The command-line options and library names for debug and release configurations as generally quite similar; in the following tables, the letters in brackets should be supplied only for debug configurations. The names of the dynamic variants of the runtime libraries are provided in parentheses; these libraries must be available at runtime if dynamic linking is selected.
Table 1-30. Compiler options for runtime library selection using Visual C++ or Intel (Windows)
|
Static linking |
Dynamic linking | |
|---|---|---|
|
Single-threaded ... |