|
|
@@ -23,43 +23,43 @@ should follow the instructions for <a class="reference" href="unix-variants.html
|
|
|
variants</a>. Other command shells, such as <a class="reference" href="http://mingw.org">MinGW</a>'s MSYS, are
|
|
|
not supported—they may or may not work.</p>
|
|
|
</div>
|
|
|
-<div class="contents topic">
|
|
|
-<p class="topic-title first"><a id="index" name="index">Index</a></p>
|
|
|
+<div class="contents topic" id="index">
|
|
|
+<p class="topic-title first">Index</p>
|
|
|
<ul class="auto-toc simple">
|
|
|
-<li><a class="reference" href="#get-boost" id="id21" name="id21">1 Get Boost</a></li>
|
|
|
-<li><a class="reference" href="#the-boost-distribution" id="id22" name="id22">2 The Boost Distribution</a></li>
|
|
|
-<li><a class="reference" href="#header-only-libraries" id="id23" name="id23">3 Header-Only Libraries</a></li>
|
|
|
-<li><a class="reference" href="#build-a-simple-program-using-boost" id="id24" name="id24">4 Build a Simple Program Using Boost</a><ul class="auto-toc">
|
|
|
-<li><a class="reference" href="#build-from-the-visual-studio-ide" id="id25" name="id25">4.1 Build From the Visual Studio IDE</a></li>
|
|
|
-<li><a class="reference" href="#or-build-from-the-command-prompt" id="id26" name="id26">4.2 Or, Build From the Command Prompt</a></li>
|
|
|
-<li><a class="reference" href="#errors-and-warnings" id="id27" name="id27">4.3 Errors and Warnings</a></li>
|
|
|
+<li><a class="reference" href="#get-boost" id="id22">1 Get Boost</a></li>
|
|
|
+<li><a class="reference" href="#the-boost-distribution" id="id23">2 The Boost Distribution</a></li>
|
|
|
+<li><a class="reference" href="#header-only-libraries" id="id24">3 Header-Only Libraries</a></li>
|
|
|
+<li><a class="reference" href="#build-a-simple-program-using-boost" id="id25">4 Build a Simple Program Using Boost</a><ul class="auto-toc">
|
|
|
+<li><a class="reference" href="#build-from-the-visual-studio-ide" id="id26">4.1 Build From the Visual Studio IDE</a></li>
|
|
|
+<li><a class="reference" href="#or-build-from-the-command-prompt" id="id27">4.2 Or, Build From the Command Prompt</a></li>
|
|
|
+<li><a class="reference" href="#errors-and-warnings" id="id28">4.3 Errors and Warnings</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
-<li><a class="reference" href="#prepare-to-use-a-boost-library-binary" id="id28" name="id28">5 Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
|
|
|
-<li><a class="reference" href="#install-visual-studio-2005-or-net-2003-binaries" id="id29" name="id29">5.1 Install Visual Studio (2005 or .NET 2003) Binaries</a></li>
|
|
|
-<li><a class="reference" href="#or-build-and-install-binaries-from-source" id="id30" name="id30">5.2 Or, Build and Install Binaries From Source</a><ul class="auto-toc">
|
|
|
-<li><a class="reference" href="#get-bjam" id="id31" name="id31">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
|
|
|
-<li><a class="reference" href="#identify-your-toolset" id="id32" name="id32">5.2.2 Identify Your Toolset</a></li>
|
|
|
-<li><a class="reference" href="#select-a-build-directory" id="id33" name="id33">5.2.3 Select a Build Directory</a></li>
|
|
|
-<li><a class="reference" href="#invoke-bjam" id="id34" name="id34">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
|
|
|
+<li><a class="reference" href="#prepare-to-use-a-boost-library-binary" id="id29">5 Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
|
|
|
+<li><a class="reference" href="#install-visual-studio-2005-or-net-2003-binaries" id="id30">5.1 Install Visual Studio (2005 or .NET 2003) Binaries</a></li>
|
|
|
+<li><a class="reference" href="#or-build-and-install-binaries-from-source" id="id31">5.2 Or, Build and Install Binaries From Source</a><ul class="auto-toc">
|
|
|
+<li><a class="reference" href="#get-bjam" id="id32">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
|
|
|
+<li><a class="reference" href="#identify-your-toolset" id="id33">5.2.2 Identify Your Toolset</a></li>
|
|
|
+<li><a class="reference" href="#select-a-build-directory" id="id34">5.2.3 Select a Build Directory</a></li>
|
|
|
+<li><a class="reference" href="#invoke-bjam" id="id35">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
-<li><a class="reference" href="#expected-build-output" id="id35" name="id35">5.3 Expected Build Output</a></li>
|
|
|
-<li><a class="reference" href="#in-case-of-build-errors" id="id36" name="id36">5.4 In Case of Build Errors</a></li>
|
|
|
+<li><a class="reference" href="#expected-build-output" id="id36">5.3 Expected Build Output</a></li>
|
|
|
+<li><a class="reference" href="#in-case-of-build-errors" id="id37">5.4 In Case of Build Errors</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
-<li><a class="reference" href="#link-your-program-to-a-boost-library" id="id37" name="id37">6 Link Your Program to a Boost Library</a><ul class="auto-toc">
|
|
|
-<li><a class="reference" href="#link-from-within-the-visual-studio-ide" id="id38" name="id38">6.1 Link From Within the Visual Studio IDE</a></li>
|
|
|
-<li><a class="reference" href="#or-link-from-the-command-prompt" id="id39" name="id39">6.2 Or, Link From the Command Prompt</a></li>
|
|
|
-<li><a class="reference" href="#library-naming" id="id40" name="id40">6.3 Library Naming</a></li>
|
|
|
-<li><a class="reference" href="#test-your-program" id="id41" name="id41">6.4 Test Your Program</a></li>
|
|
|
+<li><a class="reference" href="#link-your-program-to-a-boost-library" id="id38">6 Link Your Program to a Boost Library</a><ul class="auto-toc">
|
|
|
+<li><a class="reference" href="#link-from-within-the-visual-studio-ide" id="id39">6.1 Link From Within the Visual Studio IDE</a></li>
|
|
|
+<li><a class="reference" href="#or-link-from-the-command-prompt" id="id40">6.2 Or, Link From the Command Prompt</a></li>
|
|
|
+<li><a class="reference" href="#library-naming" id="id41">6.3 Library Naming</a></li>
|
|
|
+<li><a class="reference" href="#test-your-program" id="id42">6.4 Test Your Program</a></li>
|
|
|
</ul>
|
|
|
</li>
|
|
|
-<li><a class="reference" href="#conclusion-and-further-resources" id="id42" name="id42">7 Conclusion and Further Resources</a></li>
|
|
|
+<li><a class="reference" href="#conclusion-and-further-resources" id="id43">7 Conclusion and Further Resources</a></li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id21" id="get-boost" name="get-boost">1 Get Boost</a></h1>
|
|
|
+<div class="section" id="get-boost">
|
|
|
+<h1><a class="toc-backref" href="#id22">1 Get Boost</a></h1>
|
|
|
<p>The easiest way to get a copy of Boost is to use the <a class="reference" href="http://www.boost-consulting.com/download/windows">installer</a>
|
|
|
provided by <a class="reference" href="http://www.boost-consulting.com">Boost Consulting</a>. We especially recommend this
|
|
|
method if you use Microsoft Visual Studio .NET 2003 or Microsoft
|
|
|
@@ -70,13 +70,13 @@ install the <a class="reference" href="../../libs/regex/index.html">Boost.Regex<
|
|
|
<p>If you're using an earlier version of Visual Studio or some other
|
|
|
compiler, or if you prefer to build everything yourself, you can
|
|
|
download <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=376197"><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt><tt class="docutils literal"><span class="pre">.exe</span></tt></a> and run it to install a complete Boost
|
|
|
-distribution.<a class="footnote-reference" href="#zip" id="id2" name="id2"><sup>1</sup></a></p>
|
|
|
+distribution.<a class="footnote-reference" href="#zip" id="id2"><sup>1</sup></a></p>
|
|
|
<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
|
|
|
<!-- Software License, Version 1.0. (See accompanying -->
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id22" id="the-boost-distribution" name="the-boost-distribution">2 The Boost Distribution</a></h1>
|
|
|
+<div class="section" id="the-boost-distribution">
|
|
|
+<h1><a class="toc-backref" href="#id23">2 The Boost Distribution</a></h1>
|
|
|
<p>This is a sketch of the resulting directory structure:</p>
|
|
|
<pre class="literal-block">
|
|
|
<strong>boost_1_34_0</strong><strong>\</strong> .................<em>The “boost root directory”</em>
|
|
|
@@ -158,8 +158,8 @@ contains a subset of the Boost documentation. Start with
|
|
|
<!-- Software License, Version 1.0. (See accompanying -->
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id23" id="header-only-libraries" name="header-only-libraries">3 Header-Only Libraries</a></h1>
|
|
|
+<div class="section" id="header-only-libraries">
|
|
|
+<h1><a class="toc-backref" href="#id24">3 Header-Only Libraries</a></h1>
|
|
|
<p>The first thing many people want to know is, “how do I build
|
|
|
Boost?” The good news is that often, there's nothing to build.</p>
|
|
|
<div class="admonition-nothing-to-build admonition">
|
|
|
@@ -169,12 +169,14 @@ of header files</em> containing templates and inline functions, and
|
|
|
require no separately-compiled library binaries or special
|
|
|
treatment when linking.</p>
|
|
|
</div>
|
|
|
-<p id="separate">The only Boost libraries that <em>must</em> be built separately are:</p>
|
|
|
+<!-- .. _separate: -->
|
|
|
+<p>The only Boost libraries that <em>must</em> be built separately are:</p>
|
|
|
<ul class="simple">
|
|
|
<li><a class="reference" href="../../libs/filesystem/index.html">Boost.Filesystem</a></li>
|
|
|
<li><a class="reference" href="../../libs/iostreams/index.html">Boost.IOStreams</a></li>
|
|
|
<li><a class="reference" href="../../libs/program_options/index.html">Boost.ProgramOptions</a></li>
|
|
|
-<li><a class="reference" href="../../libs/python/doc/building.html">Boost.Python</a></li>
|
|
|
+<li><a class="reference" href="../../libs/python/doc/building.html">Boost.Python</a> (see the <a class="reference" href="../../libs/python/doc/building.html">Boost.Python build documentation</a>
|
|
|
+before building and installing it)</li>
|
|
|
<li><a class="reference" href="../../libs/regex/index.html">Boost.Regex</a></li>
|
|
|
<li><a class="reference" href="../../libs/serialization/index.html">Boost.Serialization</a></li>
|
|
|
<li><a class="reference" href="../../libs/signals/index.html">Boost.Signals</a></li>
|
|
|
@@ -196,8 +198,8 @@ use</strong>.</li>
|
|
|
<!-- Software License, Version 1.0. (See accompanying -->
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id24" id="build-a-simple-program-using-boost" name="build-a-simple-program-using-boost">4 Build a Simple Program Using Boost</a></h1>
|
|
|
+<div class="section" id="build-a-simple-program-using-boost">
|
|
|
+<h1><a class="toc-backref" href="#id25">4 Build a Simple Program Using Boost</a></h1>
|
|
|
<p>To keep things simple, let's start by using a header-only library.
|
|
|
The following program reads a sequence of integers from standard
|
|
|
input, uses Boost.Lambda to multiply each number by three, and
|
|
|
@@ -218,8 +220,8 @@ int main()
|
|
|
}
|
|
|
</pre>
|
|
|
<p>Copy the text of this program into a file called <tt class="docutils literal"><span class="pre">example.cpp</span></tt>.</p>
|
|
|
-<div class="note">
|
|
|
-<p class="first admonition-title"><a id="command-line-tool" name="command-line-tool"><span id="command-prompt"></span>Note</a></p>
|
|
|
+<div class="note" id="command-line-tool">
|
|
|
+<span id="command-prompt"></span><p class="first admonition-title">Note</p>
|
|
|
<p class="last">To build the examples in this guide, you can use an
|
|
|
Integrated Development Environment (IDE) like Visual Studio, or
|
|
|
you can issue commands from the <a class="reference" href="#command-prompt">command prompt</a>. Since every
|
|
|
@@ -252,8 +254,8 @@ cd <tt class="docutils literal"><span class="pre">C:\Program</span> <span class=
|
|
|
caret (<tt class="docutils literal"><span class="pre">^</span></tt>) at the end of all but the last line. Some examples
|
|
|
on this page use that technique to save horizontal space.</p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id25" id="build-from-the-visual-studio-ide" name="build-from-the-visual-studio-ide"><span id="vs-header-only"></span>4.1 Build From the Visual Studio IDE</a></h2>
|
|
|
+<div class="section" id="build-from-the-visual-studio-ide">
|
|
|
+<span id="vs-header-only"></span><h2><a class="toc-backref" href="#id26">4.1 Build From the Visual Studio IDE</a></h2>
|
|
|
<ul>
|
|
|
<li><p class="first">From Visual Studio's <em>File</em> menu, select <em>New</em> > <em>Project…</em></p>
|
|
|
</li>
|
|
|
@@ -276,7 +278,7 @@ Directories</em>, enter the path to the Boost root directory, for example</p>
|
|
|
</li>
|
|
|
<li><p class="first">In <em>Configuration Properties</em> > <em>C/C++</em> > <em>Precompiled Headers</em>, change
|
|
|
<em>Use Precompiled Header (/Yu)</em> to <em>Not Using Precompiled
|
|
|
-Headers</em>.<a class="footnote-reference" href="#pch" id="id4" name="id4"><sup>3</sup></a></p>
|
|
|
+Headers</em>.<a class="footnote-reference" href="#pch" id="id5"><sup>3</sup></a></p>
|
|
|
</li>
|
|
|
<li><p class="first">Replace the contents of the <tt class="docutils literal"><span class="pre">example.cpp</span></tt> generated by the IDE
|
|
|
with the example code above.</p>
|
|
|
@@ -293,8 +295,8 @@ into the resulting window, followed by the Return key:</p>
|
|
|
Return key.</p>
|
|
|
<p><a class="reference" href="#errors-and-warnings"><em>skip to the next step</em></a></p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id26" id="or-build-from-the-command-prompt" name="or-build-from-the-command-prompt">4.2 Or, Build From the Command Prompt</a></h2>
|
|
|
+<div class="section" id="or-build-from-the-command-prompt">
|
|
|
+<h2><a class="toc-backref" href="#id27">4.2 Or, Build From the Command Prompt</a></h2>
|
|
|
<p>From your computer's <em>Start</em> menu, if you are a Visual
|
|
|
Studio 2005 user, select</p>
|
|
|
<blockquote>
|
|
|
@@ -319,11 +321,11 @@ echo 1 2 3 | example
|
|
|
<!-- Software License, Version 1.0. (See accompanying -->
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id27" id="errors-and-warnings" name="errors-and-warnings">4.3 Errors and Warnings</a></h2>
|
|
|
+<div class="section" id="errors-and-warnings">
|
|
|
+<h2><a class="toc-backref" href="#id28">4.3 Errors and Warnings</a></h2>
|
|
|
<p>Don't be alarmed if you see compiler warnings originating in Boost
|
|
|
headers. We try to eliminate them, but doing so isn't always
|
|
|
-practical.<a class="footnote-reference" href="#warnings" id="id6" name="id6"><sup>5</sup></a> <strong>Errors are another matter</strong>. If you're
|
|
|
+practical.<a class="footnote-reference" href="#warnings" id="id7"><sup>5</sup></a> <strong>Errors are another matter</strong>. If you're
|
|
|
seeing compilation errors at this point in the tutorial, check to
|
|
|
be sure you've copied the <a class="reference" href="#build-a-simple-program-using-boost">example program</a> correctly and that you've
|
|
|
correctly identified the <a class="reference" href="#boost-root-directory">Boost root directory</a>.</p>
|
|
|
@@ -332,12 +334,12 @@ correctly identified the <a class="reference" href="#boost-root-directory">Boost
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id28" id="prepare-to-use-a-boost-library-binary" name="prepare-to-use-a-boost-library-binary">5 Prepare to Use a Boost Library Binary</a></h1>
|
|
|
+<div class="section" id="prepare-to-use-a-boost-library-binary">
|
|
|
+<h1><a class="toc-backref" href="#id29">5 Prepare to Use a Boost Library Binary</a></h1>
|
|
|
<p>If you want to use any of the separately-compiled Boost libraries,
|
|
|
you'll need to acquire library binaries.</p>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id29" id="install-visual-studio-2005-or-net-2003-binaries" name="install-visual-studio-2005-or-net-2003-binaries">5.1 Install Visual Studio (2005 or .NET 2003) Binaries</a></h2>
|
|
|
+<div class="section" id="install-visual-studio-2005-or-net-2003-binaries">
|
|
|
+<h2><a class="toc-backref" href="#id30">5.1 Install Visual Studio (2005 or .NET 2003) Binaries</a></h2>
|
|
|
<p>The <a class="reference" href="http://www.boost-consulting.com/download/windows">installer</a> supplied by Boost Consulting will download and
|
|
|
install pre-compiled binaries into the <tt class="docutils literal"><span class="pre">lib\</span></tt> subdirectory of the
|
|
|
boost root, typically <tt class="docutils literal"><span class="pre">C:\Program</span> <span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt><tt class="docutils literal"><span class="pre">\lib\</span></tt>. If you installed
|
|
|
@@ -346,8 +348,8 @@ step. Otherwise, please run the installer again and install them
|
|
|
now.</p>
|
|
|
<p><a class="reference" href="#link-your-program-to-a-boost-library"><em>skip to the next step</em></a></p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id30" id="or-build-and-install-binaries-from-source" name="or-build-and-install-binaries-from-source">5.2 Or, Build and Install Binaries From Source</a></h2>
|
|
|
+<div class="section" id="or-build-and-install-binaries-from-source">
|
|
|
+<h2><a class="toc-backref" href="#id31">5.2 Or, Build and Install Binaries From Source</a></h2>
|
|
|
<p>If you're using an earlier version of Visual C++, or a compiler
|
|
|
from another vendor, you'll need to use <a class="reference" href="../../tools/build/index.html">Boost.Build</a> to create your
|
|
|
own binaries.</p>
|
|
|
@@ -357,8 +359,9 @@ own binaries.</p>
|
|
|
<p><a class="reference" href="../../tools/build/index.html">Boost.Build</a> is a text-based system for developing, testing, and
|
|
|
installing software. To use it, you'll need an executable called
|
|
|
<tt class="docutils literal"><span class="pre">bjam</span></tt>.</p>
|
|
|
-<div class="section">
|
|
|
-<h3><a class="toc-backref" href="#id31" id="get-bjam" name="get-bjam">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
|
|
|
+<!-- .. _Boost.Jam documentation: Boost.Jam_ -->
|
|
|
+<div class="section" id="get-bjam">
|
|
|
+<h3><a class="toc-backref" href="#id32">5.2.1 Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
|
|
|
<p><tt class="docutils literal"><span class="pre">bjam</span></tt> is the <a class="reference" href="#command-line-tool">command-line tool</a> that drives the Boost Build
|
|
|
system. To build Boost binaries, you'll invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> from the
|
|
|
Boost root.</p>
|
|
|
@@ -366,8 +369,8 @@ Boost root.</p>
|
|
|
Alternatively, you can build <tt class="docutils literal"><span class="pre">bjam</span></tt> yourself using <a class="reference" href="../../doc/html/jam/building.html">these
|
|
|
instructions</a>.</p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h3><a class="toc-backref" href="#id32" id="identify-your-toolset" name="identify-your-toolset"><span id="toolset-name"></span><span id="toolset"></span>5.2.2 Identify Your Toolset</a></h3>
|
|
|
+<div class="section" id="identify-your-toolset">
|
|
|
+<span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id33">5.2.2 Identify Your Toolset</a></h3>
|
|
|
<p>First, find the toolset corresponding to your compiler in the
|
|
|
following table.</p>
|
|
|
<table border="1" class="docutils">
|
|
|
@@ -468,22 +471,22 @@ affect this step in any way; you still need to select a Boost.Build
|
|
|
toolset from the table.</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h3><a class="toc-backref" href="#id33" id="select-a-build-directory" name="select-a-build-directory"><span id="id11"></span><span id="build-directory"></span>5.2.3 Select a Build Directory</a></h3>
|
|
|
+<div class="section" id="select-a-build-directory">
|
|
|
+<span id="id12"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id34">5.2.3 Select a Build Directory</a></h3>
|
|
|
<p><a class="reference" href="../../tools/build/index.html">Boost.Build</a> will place all intermediate files it generates while
|
|
|
building into the <strong>build directory</strong>. If your Boost root
|
|
|
directory is writable, this step isn't strictly necessary: by
|
|
|
default Boost.Build will create a <tt class="docutils literal"><span class="pre">bin.v2/</span></tt> subdirectory for that
|
|
|
purpose in your current working directory.</p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h3><a class="toc-backref" href="#id34" id="invoke-bjam" name="invoke-bjam">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
|
|
|
+<div class="section" id="invoke-bjam">
|
|
|
+<h3><a class="toc-backref" href="#id35">5.2.4 Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
|
|
|
<p>Change your current directory to the Boost root directory and
|
|
|
invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> as follows:</p>
|
|
|
<pre class="literal-block">
|
|
|
-bjam <strong>--build-dir=</strong><a class="reference" href="#id11"><em>build-directory</em></a> <strong>--toolset=</strong><a class="reference" href="#toolset-name"><em>toolset-name</em></a> stage
|
|
|
+bjam <strong>--build-dir=</strong><a class="reference" href="#id12"><em>build-directory</em></a> <strong>--toolset=</strong><a class="reference" href="#toolset-name"><em>toolset-name</em></a> stage
|
|
|
</pre>
|
|
|
-<p>For example, your session might look like this:<a class="footnote-reference" href="#continuation" id="id12" name="id12"><sup>4</sup></a></p>
|
|
|
+<p>For example, your session might look like this:<a class="footnote-reference" href="#continuation" id="id13"><sup>4</sup></a></p>
|
|
|
<pre class="literal-block">
|
|
|
C:WINDOWS> cd <tt class="docutils literal"><span class="pre">C:\Program</span> <span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
|
|
|
<tt class="docutils literal"><span class="pre">C:\Program</span> <span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>> bjam <strong>^</strong>
|
|
|
@@ -515,8 +518,8 @@ be interested in:</p>
|
|
|
</ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id35" id="expected-build-output" name="expected-build-output">5.3 Expected Build Output</a></h2>
|
|
|
+<div class="section" id="expected-build-output">
|
|
|
+<h2><a class="toc-backref" href="#id36">5.3 Expected Build Output</a></h2>
|
|
|
<p>During the process of building Boost libraries, you can expect to
|
|
|
see some messages printed on the console. These may include</p>
|
|
|
<ul>
|
|
|
@@ -539,8 +542,8 @@ look something like:</p>
|
|
|
</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id36" id="in-case-of-build-errors" name="in-case-of-build-errors">5.4 In Case of Build Errors</a></h2>
|
|
|
+<div class="section" id="in-case-of-build-errors">
|
|
|
+<h2><a class="toc-backref" href="#id37">5.4 In Case of Build Errors</a></h2>
|
|
|
<p>The only error messages you see when building Boost—if any—should
|
|
|
be related to the IOStreams library's support of zip and bzip2
|
|
|
formats as described <a class="reference" href="../../libs/iostreams/doc/installation.html">here</a>. Install the relevant development
|
|
|
@@ -557,8 +560,8 @@ questions about configuring Boost for your compiler to the
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id37" id="link-your-program-to-a-boost-library" name="link-your-program-to-a-boost-library">6 Link Your Program to a Boost Library</a></h1>
|
|
|
+<div class="section" id="link-your-program-to-a-boost-library">
|
|
|
+<h1><a class="toc-backref" href="#id38">6 Link Your Program to a Boost Library</a></h1>
|
|
|
<p>To demonstrate linking with a Boost binary library, we'll use the
|
|
|
following simple program that extracts the subject lines from
|
|
|
emails. It uses the <a class="reference" href="../../libs/regex/index.html">Boost.Regex</a> library, which has a
|
|
|
@@ -599,8 +602,8 @@ information to encode the name of the correct library into your
|
|
|
object files; the linker selects the library with that name from
|
|
|
the directories you've told it to search.</p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id38" id="link-from-within-the-visual-studio-ide" name="link-from-within-the-visual-studio-ide">6.1 Link From Within the Visual Studio IDE</a></h2>
|
|
|
+<div class="section" id="link-from-within-the-visual-studio-ide">
|
|
|
+<h2><a class="toc-backref" href="#id39">6.1 Link From Within the Visual Studio IDE</a></h2>
|
|
|
<p>Starting with the <a class="reference" href="#vs-header-only">header-only example project</a> we created
|
|
|
earlier:</p>
|
|
|
<ol class="arabic simple">
|
|
|
@@ -613,8 +616,8 @@ e.g. <tt class="docutils literal"><span class="pre">C:\Program</span> <span clas
|
|
|
</ol>
|
|
|
<p><a class="reference" href="#test-your-program"><em>skip to the next step</em></a></p>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id39" id="or-link-from-the-command-prompt" name="or-link-from-the-command-prompt">6.2 Or, Link From the Command Prompt</a></h2>
|
|
|
+<div class="section" id="or-link-from-the-command-prompt">
|
|
|
+<h2><a class="toc-backref" href="#id40">6.2 Or, Link From the Command Prompt</a></h2>
|
|
|
<p>For example, we can compile and link the above program from the
|
|
|
Visual C++ command-line by simply adding the <strong>bold</strong> text below to
|
|
|
the command line we used earlier, assuming your Boost binaries are
|
|
|
@@ -624,8 +627,8 @@ cl /EHsc /I <em>path\to\</em><tt class="docutils literal"><span class="pre">boos
|
|
|
<strong>/link /LIBPATH:</strong> <strong>C:\Program Files\boost\</strong><strong>boost_1_34_0</strong><strong>\lib</strong>
|
|
|
</pre>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id40" id="library-naming" name="library-naming">6.3 Library Naming</a></h2>
|
|
|
+<div class="section" id="library-naming">
|
|
|
+<h2><a class="toc-backref" href="#id41">6.3 Library Naming</a></h2>
|
|
|
<div class="note">
|
|
|
<p class="first admonition-title">Note</p>
|
|
|
<p>If, like Visual C++, your compiler supports auto-linking,
|
|
|
@@ -647,11 +650,11 @@ following elements:</p>
|
|
|
<dd><em>Prefix</em>: except on Microsoft Windows, every Boost library
|
|
|
name begins with this string. On Windows, only ordinary static
|
|
|
libraries use the <tt class="docutils literal"><span class="pre">lib</span></tt> prefix; import libraries and DLLs do
|
|
|
-not.<a class="footnote-reference" href="#distinct" id="id17" name="id17"><sup>6</sup></a></dd>
|
|
|
+not.<a class="footnote-reference" href="#distinct" id="id18"><sup>6</sup></a></dd>
|
|
|
<dt><tt class="docutils literal"><span class="pre">boost_regex</span></tt></dt>
|
|
|
<dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal"><span class="pre">boost_</span></tt>.</dd>
|
|
|
<dt><tt class="docutils literal"><span class="pre">-vc71</span></tt></dt>
|
|
|
-<dd><em>Toolset tag</em>: identifies the toolset and version used to build
|
|
|
+<dd><em>Toolset tag</em>: identifies the <a class="reference" href="#toolset">toolset</a> and version used to build
|
|
|
the binary.</dd>
|
|
|
<dt><tt class="docutils literal"><span class="pre">-mt</span></tt></dt>
|
|
|
<dd><em>Threading tag</em>: indicates that the library was
|
|
|
@@ -685,14 +688,14 @@ libraries.</td>
|
|
|
<td>using a special <a class="reference" href="../../libs/python/doc/building.html#variants">debug build of Python</a>.</td>
|
|
|
</tr>
|
|
|
<tr><td><tt class="docutils literal"><span class="pre">d</span></tt></td>
|
|
|
-<td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id18" name="id18"><sup>7</sup></a></td>
|
|
|
+<td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id19"><sup>7</sup></a></td>
|
|
|
</tr>
|
|
|
<tr><td><tt class="docutils literal"><span class="pre">p</span></tt></td>
|
|
|
<td>using the STLPort standard library rather than the default one supplied with
|
|
|
your compiler.</td>
|
|
|
</tr>
|
|
|
<tr><td><tt class="docutils literal"><span class="pre">n</span></tt></td>
|
|
|
-<td>using STLPort's deprecated “native iostreams” feature.<a class="footnote-reference" href="#native" id="id19" name="id19"><sup>8</sup></a></td>
|
|
|
+<td>using STLPort's deprecated “native iostreams” feature.<a class="footnote-reference" href="#native" id="id20"><sup>8</sup></a></td>
|
|
|
</tr>
|
|
|
</tbody>
|
|
|
</table>
|
|
|
@@ -713,18 +716,19 @@ convention. On most unix-style platforms the extensions are
|
|
|
<tt class="docutils literal"><span class="pre">.a</span></tt> and <tt class="docutils literal"><span class="pre">.so</span></tt> for static libraries (archives) and shared
|
|
|
libraries, respectively. On Windows, <tt class="docutils literal"><span class="pre">.dll</span></tt> indicates a shared
|
|
|
library and (except for static libraries built by the <tt class="docutils literal"><span class="pre">gcc</span></tt>
|
|
|
-toolset, whose names always end in <tt class="docutils literal"><span class="pre">.a</span></tt>) <tt class="docutils literal"><span class="pre">.lib</span></tt> indicates a
|
|
|
+<a class="reference" href="#toolset">toolset</a>, whose names always end in <tt class="docutils literal"><span class="pre">.a</span></tt>) <tt class="docutils literal"><span class="pre">.lib</span></tt> indicates a
|
|
|
static or import library. Where supported by toolsets on unix
|
|
|
variants, a full version extension is added (e.g. ".so.1.34") and
|
|
|
a symbolic link to the library file, named without the trailing
|
|
|
version number, will also be created.</dd>
|
|
|
</dl>
|
|
|
+<!-- .. _Boost.Build toolset names: toolset-name_ -->
|
|
|
<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
|
|
|
<!-- Software License, Version 1.0. (See accompanying -->
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h2><a class="toc-backref" href="#id41" id="test-your-program" name="test-your-program">6.4 Test Your Program</a></h2>
|
|
|
+<div class="section" id="test-your-program">
|
|
|
+<h2><a class="toc-backref" href="#id42">6.4 Test Your Program</a></h2>
|
|
|
<p>To test our subject extraction, we'll filter the following text
|
|
|
file. Copy it out of your browser and save it as <tt class="docutils literal"><span class="pre">jayne.txt</span></tt>:</p>
|
|
|
<pre class="literal-block">
|
|
|
@@ -745,8 +749,8 @@ Spoil Rock Hunter?”</p>
|
|
|
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
|
|
</div>
|
|
|
</div>
|
|
|
-<div class="section">
|
|
|
-<h1><a class="toc-backref" href="#id42" id="conclusion-and-further-resources" name="conclusion-and-further-resources">7 Conclusion and Further Resources</a></h1>
|
|
|
+<div class="section" id="conclusion-and-further-resources">
|
|
|
+<h1><a class="toc-backref" href="#id43">7 Conclusion and Further Resources</a></h1>
|
|
|
<p>This concludes your introduction to Boost and to integrating it
|
|
|
with your programs. As you start using Boost in earnest, there are
|
|
|
surely a few additional points you'll wish we had covered. One day
|
|
|
@@ -774,7 +778,7 @@ mailing list</a>.</p>
|
|
|
<table class="docutils footnote" frame="void" id="zip" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id2" name="zip">[1]</a></td><td>If you prefer not to download executable programs,
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td>If you prefer not to download executable programs,
|
|
|
download <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=376197"><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt><tt class="docutils literal"><span class="pre">.zip</span></tt></a> and use an external tool to decompress
|
|
|
it. We don't recommend using Windows' built-in decompression as
|
|
|
it can be painfully slow for large archives.</td></tr>
|
|
|
@@ -783,7 +787,7 @@ it can be painfully slow for large archives.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="installer-src" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a name="installer-src">[2]</a></td><td>If you used the <a class="reference" href="http://www.boost-consulting.com/download/windows">installer</a> from Boost
|
|
|
+<tr><td class="label">[2]</td><td>If you used the <a class="reference" href="http://www.boost-consulting.com/download/windows">installer</a> from Boost
|
|
|
Consulting and deselected “Source and Documentation” (it's
|
|
|
selected by default), you won't see the <tt class="docutils literal"><span class="pre">libs/</span></tt> subdirectory.
|
|
|
That won't affect your ability to use precompiled binaries, but
|
|
|
@@ -793,7 +797,7 @@ you won't be able to rebuild libraries from scratch.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="pch" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id4" name="pch">[3]</a></td><td>There's no problem using Boost with precompiled headers;
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id5">[3]</a></td><td>There's no problem using Boost with precompiled headers;
|
|
|
these instructions merely avoid precompiled headers because it
|
|
|
would require Visual Studio-specific changes to the source code
|
|
|
used in the examples.</td></tr>
|
|
|
@@ -802,7 +806,7 @@ used in the examples.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="continuation" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id12" name="continuation">[4]</a></td><td>In this example, the caret character <tt class="docutils literal"><span class="pre">^</span></tt> is a
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id13">[4]</a></td><td>In this example, the caret character <tt class="docutils literal"><span class="pre">^</span></tt> is a
|
|
|
way of continuing the command on multiple lines. The command
|
|
|
prompt responds with <tt class="docutils literal"><span class="pre">More?</span></tt> to prompt for more input. Feel
|
|
|
free to omit the carets and subsequent newlines; we used them so
|
|
|
@@ -815,7 +819,7 @@ the example would fit on a page of reasonable width.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="warnings" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id6" name="warnings">[5]</a></td><td>Remember that warnings are specific to each compiler
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id7">[5]</a></td><td>Remember that warnings are specific to each compiler
|
|
|
implementation. The developer of a given Boost library might
|
|
|
not have access to your compiler. Also, some warnings are
|
|
|
extremely difficult to eliminate in generic code, to the point
|
|
|
@@ -826,7 +830,7 @@ have any source code mechanism for suppressing warnings.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="distinct" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id17" name="distinct">[6]</a></td><td>This convention distinguishes the static version of
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id18">[6]</a></td><td>This convention distinguishes the static version of
|
|
|
a Boost library from the import library for an
|
|
|
identically-configured Boost DLL, which would otherwise have the
|
|
|
same name.</td></tr>
|
|
|
@@ -835,7 +839,7 @@ same name.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="debug-abi" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id18" name="debug-abi">[7]</a></td><td>These libraries were compiled without optimization
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id19">[7]</a></td><td>These libraries were compiled without optimization
|
|
|
or inlining, with full debug symbols enabled, and without
|
|
|
<tt class="docutils literal"><span class="pre">NDEBUG</span></tt> <tt class="docutils literal"><span class="pre">#define</span></tt>d. Although it's true that sometimes
|
|
|
these choices don't affect binary compatibility with other
|
|
|
@@ -845,7 +849,7 @@ compiled code, you can't count on that with Boost libraries.</td></tr>
|
|
|
<table class="docutils footnote" frame="void" id="native" rules="none">
|
|
|
<colgroup><col class="label" /><col /></colgroup>
|
|
|
<tbody valign="top">
|
|
|
-<tr><td class="label"><a class="fn-backref" href="#id19" name="native">[8]</a></td><td>This feature of STLPort is deprecated because it's
|
|
|
+<tr><td class="label"><a class="fn-backref" href="#id20">[8]</a></td><td>This feature of STLPort is deprecated because it's
|
|
|
impossible to make it work transparently to the user; we don't
|
|
|
recommend it.</td></tr>
|
|
|
</tbody>
|