~barry/ubuntu/precise/boost1.46/debian-merge

« back to all changes in this revision

Viewing changes to more/getting_started/windows.html

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2011-03-13 00:37:35 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110313003735-r7j6jdk0hkywfzuw
Tags: 1.46.1-1
* New upstream.

* control: Add libboost-random1.46-dev to depends of -all-dev and
  suggests of -dev.  Closes: #615849.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
<div class="contents topic" id="index">
27
27
<p class="topic-title first">Index</p>
28
28
<ul class="auto-toc simple">
29
 
<li><a class="reference internal" href="#get-boost" id="id29">1&nbsp;&nbsp;&nbsp;Get Boost</a></li>
30
 
<li><a class="reference internal" href="#the-boost-distribution" id="id30">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></li>
31
 
<li><a class="reference internal" href="#header-only-libraries" id="id31">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
32
 
<li><a class="reference internal" href="#build-a-simple-program-using-boost" id="id32">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
33
 
<li><a class="reference internal" href="#build-from-the-visual-studio-ide" id="id33">4.1&nbsp;&nbsp;&nbsp;Build From the Visual Studio IDE</a></li>
34
 
<li><a class="reference internal" href="#or-build-from-the-command-prompt" id="id34">4.2&nbsp;&nbsp;&nbsp;Or, Build From the Command Prompt</a></li>
35
 
<li><a class="reference internal" href="#errors-and-warnings" id="id35">4.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
36
 
</ul>
37
 
</li>
38
 
<li><a class="reference internal" href="#prepare-to-use-a-boost-library-binary" id="id36">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
39
 
<li><a class="reference internal" href="#install-visual-studio-binaries" id="id37">5.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></li>
40
 
<li><a class="reference internal" href="#or-simplified-build-from-source" id="id38">5.2&nbsp;&nbsp;&nbsp;Or, Simplified Build From Source</a></li>
41
 
<li><a class="reference internal" href="#or-build-binaries-from-source" id="id39">5.3&nbsp;&nbsp;&nbsp;Or, Build Binaries From Source</a><ul class="auto-toc">
42
 
<li><a class="reference internal" href="#get-bjam" id="id40">5.3.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal">bjam</tt></a></li>
43
 
<li><a class="reference internal" href="#identify-your-toolset" id="id41">5.3.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></li>
44
 
<li><a class="reference internal" href="#select-a-build-directory" id="id42">5.3.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></li>
45
 
<li><a class="reference internal" href="#invoke-bjam" id="id43">5.3.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></li>
46
 
</ul>
47
 
</li>
48
 
<li><a class="reference internal" href="#expected-build-output" id="id44">5.4&nbsp;&nbsp;&nbsp;Expected Build Output</a></li>
49
 
<li><a class="reference internal" href="#in-case-of-build-errors" id="id45">5.5&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></li>
50
 
</ul>
51
 
</li>
52
 
<li><a class="reference internal" href="#link-your-program-to-a-boost-library" id="id46">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a><ul class="auto-toc">
53
 
<li><a class="reference internal" href="#link-from-within-the-visual-studio-ide" id="id47">6.1&nbsp;&nbsp;&nbsp;Link From Within the Visual Studio IDE</a></li>
54
 
<li><a class="reference internal" href="#or-link-from-the-command-prompt" id="id48">6.2&nbsp;&nbsp;&nbsp;Or, Link From the Command Prompt</a></li>
55
 
<li><a class="reference internal" href="#library-naming" id="id49">6.3&nbsp;&nbsp;&nbsp;Library Naming</a></li>
56
 
<li><a class="reference internal" href="#test-your-program" id="id50">6.4&nbsp;&nbsp;&nbsp;Test Your Program</a></li>
57
 
</ul>
58
 
</li>
59
 
<li><a class="reference internal" href="#conclusion-and-further-resources" id="id51">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></li>
 
29
<li><a class="reference internal" href="#get-boost" id="id28">1&nbsp;&nbsp;&nbsp;Get Boost</a></li>
 
30
<li><a class="reference internal" href="#the-boost-distribution" id="id29">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></li>
 
31
<li><a class="reference internal" href="#header-only-libraries" id="id30">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
 
32
<li><a class="reference internal" href="#build-a-simple-program-using-boost" id="id31">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
 
33
<li><a class="reference internal" href="#build-from-the-visual-studio-ide" id="id32">4.1&nbsp;&nbsp;&nbsp;Build From the Visual Studio IDE</a></li>
 
34
<li><a class="reference internal" href="#or-build-from-the-command-prompt" id="id33">4.2&nbsp;&nbsp;&nbsp;Or, Build From the Command Prompt</a></li>
 
35
<li><a class="reference internal" href="#errors-and-warnings" id="id34">4.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
 
36
</ul>
 
37
</li>
 
38
<li><a class="reference internal" href="#prepare-to-use-a-boost-library-binary" id="id35">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
 
39
<li><a class="reference internal" href="#install-visual-studio-binaries" id="id36">5.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></li>
 
40
<li><a class="reference internal" href="#or-simplified-build-from-source" id="id37">5.2&nbsp;&nbsp;&nbsp;Or, Simplified Build From Source</a></li>
 
41
<li><a class="reference internal" href="#or-build-binaries-from-source" id="id38">5.3&nbsp;&nbsp;&nbsp;Or, Build Binaries From Source</a><ul class="auto-toc">
 
42
<li><a class="reference internal" href="#install-boost-build" id="id39">5.3.1&nbsp;&nbsp;&nbsp;Install Boost.Build</a></li>
 
43
<li><a class="reference internal" href="#identify-your-toolset" id="id40">5.3.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></li>
 
44
<li><a class="reference internal" href="#select-a-build-directory" id="id41">5.3.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></li>
 
45
<li><a class="reference internal" href="#invoke-bjam" id="id42">5.3.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></li>
 
46
</ul>
 
47
</li>
 
48
<li><a class="reference internal" href="#expected-build-output" id="id43">5.4&nbsp;&nbsp;&nbsp;Expected Build Output</a></li>
 
49
<li><a class="reference internal" href="#in-case-of-build-errors" id="id44">5.5&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></li>
 
50
</ul>
 
51
</li>
 
52
<li><a class="reference internal" href="#link-your-program-to-a-boost-library" id="id45">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a><ul class="auto-toc">
 
53
<li><a class="reference internal" href="#link-from-within-the-visual-studio-ide" id="id46">6.1&nbsp;&nbsp;&nbsp;Link From Within the Visual Studio IDE</a></li>
 
54
<li><a class="reference internal" href="#or-link-from-the-command-prompt" id="id47">6.2&nbsp;&nbsp;&nbsp;Or, Link From the Command Prompt</a></li>
 
55
<li><a class="reference internal" href="#library-naming" id="id48">6.3&nbsp;&nbsp;&nbsp;Library Naming</a></li>
 
56
<li><a class="reference internal" href="#test-your-program" id="id49">6.4&nbsp;&nbsp;&nbsp;Test Your Program</a></li>
 
57
</ul>
 
58
</li>
 
59
<li><a class="reference internal" href="#conclusion-and-further-resources" id="id50">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></li>
60
60
</ul>
61
61
</div>
62
62
<div class="section" id="get-boost">
63
 
<h1><a class="toc-backref" href="#id29">1&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
 
63
<h1><a class="toc-backref" href="#id28">1&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
64
64
<p>The easiest way to get a copy of Boost is to use an installer.  The
65
 
<a class="reference external" href="http://www.boost.org/doc/libs/1_36_0/more/getting_started/index.html">Boost website version of this Getting Started guide</a> will have
 
65
<a class="reference external" href="http://www.boost.org/more/getting_started/index.html">Boost website version of this Getting Started guide</a> will have
66
66
undated information on installers as they become available, or see
67
 
<a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041">Boost downloads</a> or the <a class="reference external" href="http://www.boostpro.com/products/free">installer</a> provided by <a class="reference external" href="http://www.boostpro.com">BoostPro
 
67
<a class="reference external" href="http://www.boost.org/users/history/version_1_46_1.html">Boost downloads</a> or the <a class="reference external" href="http://www.boostpro.com/products/free">installer</a> provided by <a class="reference external" href="http://www.boostpro.com">BoostPro
68
68
Computing</a>.  We especially recommend using an installer if you use
69
69
Microsoft Visual Studio, because the installer can download and
70
70
install precompiled library binaries, saving you the trouble of
73
73
binaries when given the option.</p>
74
74
<p>If you're using an earlier version of Visual Studio or some other
75
75
compiler, or if you prefer to build everything yourself, you can
76
 
download <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041"><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">.7z</tt></a> or <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041"><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">.zip</tt></a> and unpack it to install a complete Boost
 
76
download <a class="reference external" href="http://www.boost.org/users/history/version_1_46_1.html"><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">.7z</tt></a> or <a class="reference external" href="http://www.boost.org/users/history/version_1_46_1.html"><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">.zip</tt></a> and unpack it to install a complete Boost
77
77
distribution.<a class="footnote-reference" href="#zip" id="id2"><sup>1</sup></a></p>
78
78
<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
79
79
<!-- Software License, Version 1.0. (See accompanying -->
80
80
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
81
81
</div>
82
82
<div class="section" id="the-boost-distribution">
83
 
<h1><a class="toc-backref" href="#id30">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></h1>
 
83
<h1><a class="toc-backref" href="#id29">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></h1>
84
84
<p>This is a sketch of the resulting directory structure:</p>
85
85
<pre class="literal-block">
86
 
<strong>boost_1_46_0</strong><strong>\</strong> .................<em>The “boost root directory”</em>
 
86
<strong>boost_1_46_1</strong><strong>\</strong> .................<em>The “boost root directory”</em>
87
87
   <strong>index.htm</strong> .........<em>A copy of www.boost.org starts here</em>
88
88
   <strong>boost</strong><strong>\</strong> .........................<em>All Boost Header files</em>
89
89
   <strong>lib</strong><strong>\</strong> .....................<em>precompiled library binaries</em>
128
128
</div>
129
129
<p>It's important to note the following:</p>
130
130
<ol class="arabic" id="boost-root-directory">
131
 
<li><p class="first">The path to the <strong>boost root directory</strong> (often <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt>) is
 
131
<li><p class="first">The path to the <strong>boost root directory</strong> (often <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt>) is
132
132
sometimes referred to as <tt class="docutils literal">$BOOST_ROOT</tt> in documentation and
133
133
mailing lists .</p>
134
134
</li>
163
163
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
164
164
</div>
165
165
<div class="section" id="header-only-libraries">
166
 
<h1><a class="toc-backref" href="#id31">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></h1>
 
166
<h1><a class="toc-backref" href="#id30">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></h1>
167
167
<p>The first thing many people want to know is, “how do I build
168
168
Boost?”  The good news is that often, there's nothing to build.</p>
169
169
<div class="admonition-nothing-to-build admonition">
210
210
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
211
211
</div>
212
212
<div class="section" id="build-a-simple-program-using-boost">
213
 
<h1><a class="toc-backref" href="#id32">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a></h1>
 
213
<h1><a class="toc-backref" href="#id31">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a></h1>
214
214
<p>To keep things simple, let's start by using a header-only library.
215
215
The following program reads a sequence of integers from standard
216
216
input, uses Boost.Lambda to multiply each number by three, and
259
259
</pre>
260
260
<p>followed by Return.  For example,</p>
261
261
<pre class="literal-block">
262
 
cd <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt>
 
262
cd <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt>
263
263
</pre>
264
264
<p class="last">Long commands can be continued across several lines by typing a
265
265
caret (<tt class="docutils literal">^</tt>) at the end of all but the last line.  Some examples
266
266
on this page use that technique to save horizontal space.</p>
267
267
</div>
268
268
<div class="section" id="build-from-the-visual-studio-ide">
269
 
<span id="vs-header-only"></span><h2><a class="toc-backref" href="#id33">4.1&nbsp;&nbsp;&nbsp;Build From the Visual Studio IDE</a></h2>
 
269
<span id="vs-header-only"></span><h2><a class="toc-backref" href="#id32">4.1&nbsp;&nbsp;&nbsp;Build From the Visual Studio IDE</a></h2>
270
270
<ul>
271
271
<li><p class="first">From Visual Studio's <em>File</em> menu, select <em>New</em> &gt; <em>Project…</em></p>
272
272
</li>
284
284
<li><p class="first">In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <em>General</em> &gt; <em>Additional Include
285
285
Directories</em>, enter the path to the Boost root directory, for example</p>
286
286
<blockquote>
287
 
<p><tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt></p>
 
287
<p><tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt></p>
288
288
</blockquote>
289
289
</li>
290
290
<li><p class="first">In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <em>Precompiled Headers</em>, change
307
307
<p><a class="reference internal" href="#errors-and-warnings"><em>skip to the next step</em></a></p>
308
308
</div>
309
309
<div class="section" id="or-build-from-the-command-prompt">
310
 
<h2><a class="toc-backref" href="#id34">4.2&nbsp;&nbsp;&nbsp;Or, Build From the Command Prompt</a></h2>
 
310
<h2><a class="toc-backref" href="#id33">4.2&nbsp;&nbsp;&nbsp;Or, Build From the Command Prompt</a></h2>
311
311
<p>From your computer's <em>Start</em> menu, if you are a Visual
312
312
Studio 2005 user, select</p>
313
313
<blockquote>
322
322
directory</a> to a suitable location for creating some temporary
323
323
files and type the following command followed by the Return key:</p>
324
324
<pre class="literal-block">
325
 
cl /EHsc /I <em>path\to\</em><tt class="docutils literal">boost_1_46_0</tt> <em>path</em>\<em>to</em>\example.cpp
 
325
cl /EHsc /I <em>path\to\</em><tt class="docutils literal">boost_1_46_1</tt> <em>path</em>\<em>to</em>\example.cpp
326
326
</pre>
327
327
<p>To test the result, type:</p>
328
328
<pre class="literal-block">
333
333
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
334
334
</div>
335
335
<div class="section" id="errors-and-warnings">
336
 
<h2><a class="toc-backref" href="#id35">4.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
 
336
<h2><a class="toc-backref" href="#id34">4.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
337
337
<p>Don't be alarmed if you see compiler warnings originating in Boost
338
338
headers.  We try to eliminate them, but doing so isn't always
339
339
practical.<a class="footnote-reference" href="#warnings" id="id7"><sup>5</sup></a> <strong>Errors are another matter</strong>.  If you're
346
346
</div>
347
347
</div>
348
348
<div class="section" id="prepare-to-use-a-boost-library-binary">
349
 
<h1><a class="toc-backref" href="#id36">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a></h1>
 
349
<h1><a class="toc-backref" href="#id35">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a></h1>
350
350
<p>If you want to use any of the separately-compiled Boost libraries,
351
351
you'll need to acquire library binaries.</p>
352
352
<div class="section" id="install-visual-studio-binaries">
353
 
<h2><a class="toc-backref" href="#id37">5.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></h2>
 
353
<h2><a class="toc-backref" href="#id36">5.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></h2>
354
354
<p>The installers supplied by BoostPro Computing will download and
355
355
install pre-compiled binaries into the <tt class="docutils literal">lib\</tt> subdirectory of the
356
 
boost root, typically <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">\lib\</tt>.  If you installed
 
356
boost root, typically <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">\lib\</tt>.  If you installed
357
357
all variants of the <a class="reference external" href="../../libs/regex/index.html">Boost.Regex</a> binary, you're done with this
358
358
step.  Otherwise, please run the installer again and install them
359
359
now.</p>
360
360
<p><a class="reference internal" href="#link-your-program-to-a-boost-library"><em>skip to the next step</em></a></p>
361
361
</div>
362
362
<div class="section" id="or-simplified-build-from-source">
363
 
<h2><a class="toc-backref" href="#id38">5.2&nbsp;&nbsp;&nbsp;Or, Simplified Build From Source</a></h2>
 
363
<h2><a class="toc-backref" href="#id37">5.2&nbsp;&nbsp;&nbsp;Or, Simplified Build From Source</a></h2>
364
364
<p>If you wish to build from source with Visual C++, you can use a
365
365
simple build procedure described in this section. Open the command prompt
366
366
and change your current directory to the Boost root directory. Then, type
375
375
of options that can be passed to <tt class="docutils literal">bjam</tt>.</p>
376
376
</div>
377
377
<div class="section" id="or-build-binaries-from-source">
378
 
<h2><a class="toc-backref" href="#id39">5.3&nbsp;&nbsp;&nbsp;Or, Build Binaries From Source</a></h2>
 
378
<h2><a class="toc-backref" href="#id38">5.3&nbsp;&nbsp;&nbsp;Or, Build Binaries From Source</a></h2>
379
379
<p>If you're using an earlier version of Visual C++, or a compiler
380
380
from another vendor, you'll need to use <a class="reference external" href="../../tools/build/index.html">Boost.Build</a> to create your
381
381
own binaries.</p>
387
387
<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
388
388
<!-- Software License, Version 1.0. (See accompanying -->
389
389
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
 
390
<div class="section" id="install-boost-build">
 
391
<h3><a class="toc-backref" href="#id39">5.3.1&nbsp;&nbsp;&nbsp;Install Boost.Build</a></h3>
390
392
<p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> is a text-based system for developing, testing, and
391
 
installing software.  To use it, you'll need an executable called
392
 
<tt class="docutils literal">bjam</tt>.</p>
393
 
<!-- .. _Boost.Jam documentation: Boost.Jam_ -->
394
 
<div class="section" id="get-bjam">
395
 
<h3><a class="toc-backref" href="#id40">5.3.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal">bjam</tt></a></h3>
396
 
<p><tt class="docutils literal">bjam</tt> is the <a class="reference internal" href="#command-line-tool">command-line tool</a> that drives the Boost Build
397
 
system.  To build Boost binaries, you'll invoke <tt class="docutils literal">bjam</tt> from the
398
 
Boost root.</p>
399
 
<p>We suggest you <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=72941">download a pre-built <tt class="docutils literal">bjam</tt> executable</a> for your platform.
400
 
Alternatively, you can build <tt class="docutils literal">bjam</tt> yourself using <a class="reference external" href="../../doc/html/jam/building.html">these
401
 
instructions</a>.</p>
402
 
<p>Move the <tt class="docutils literal">bjam</tt> executable into a directory in your PATH.  You can
403
 
see the list of directories in your PATH, separated by semicolons,
404
 
by typing “<tt class="docutils literal">PATH</tt>” at the command prompt.</p>
 
393
installing software. First, you'll need to build and
 
394
install it. To do this:</p>
 
395
<ol class="arabic simple">
 
396
<li>Go to the directory <tt class="docutils literal">tools</tt><tt class="docutils literal">\</tt><tt class="docutils literal">build</tt><tt class="docutils literal">\</tt><tt class="docutils literal">v2</tt><tt class="docutils literal">\</tt>.</li>
 
397
<li>Run <tt class="docutils literal">bootstrap.bat</tt></li>
 
398
<li>Run <tt class="docutils literal">bjam install <span class="pre">--prefix=</span></tt><em>PREFIX</em> where <em>PREFIX</em> is
 
399
the directory where you want Boost.Build to be installed</li>
 
400
<li>Add <em>PREFIX</em><tt class="docutils literal">\</tt><tt class="docutils literal">bin</tt> to your PATH environment variable.</li>
 
401
</ol>
405
402
</div>
406
403
<div class="section" id="identify-your-toolset">
407
 
<span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id41">5.3.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></h3>
 
404
<span id="toolset-name"></span><span id="toolset"></span><h3><a class="toc-backref" href="#id40">5.3.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></h3>
408
405
<p>First, find the toolset corresponding to your compiler in the
409
406
following table (an up-to-date list is always available <a class="reference external" href="http://www.boost.org/boost-build2/doc/html/bbv2/reference/tools.html">in the
410
407
Boost.Build documentation</a>).</p>
411
408
<div class="note">
412
409
<p class="first admonition-title">Note</p>
413
410
<p class="last">If you previously chose a toolset for the purposes of
414
 
<a class="reference external" href="../../doc/html/jam/building.html">building bjam</a>, you should assume it won't work and instead
 
411
<a class="reference external" href="../../doc/html/bbv2/installation.html">building bjam</a>, you should assume it won't work and instead
415
412
choose newly from the table below.</p>
416
413
</div>
417
414
<table border="1" class="docutils">
506
503
detection code) or <a class="reference internal" href="#auto-linking">auto-linking</a> will fail.</p>
507
504
</div>
508
505
<div class="section" id="select-a-build-directory">
509
 
<span id="id14"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id42">5.3.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></h3>
 
506
<span id="id13"></span><span id="build-directory"></span><h3><a class="toc-backref" href="#id41">5.3.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></h3>
510
507
<p><a class="reference external" href="../../tools/build/index.html">Boost.Build</a> will place all intermediate files it generates while
511
508
building into the <strong>build directory</strong>.  If your Boost root
512
509
directory is writable, this step isn't strictly necessary: by
514
511
purpose in your current working directory.</p>
515
512
</div>
516
513
<div class="section" id="invoke-bjam">
517
 
<h3><a class="toc-backref" href="#id43">5.3.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></h3>
 
514
<h3><a class="toc-backref" href="#id42">5.3.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal">bjam</tt></a></h3>
518
515
<p>Change your current directory to the Boost root directory and
519
516
invoke <tt class="docutils literal">bjam</tt> as follows:</p>
520
517
<pre class="literal-block">
521
 
bjam <strong>--build-dir=</strong><a class="reference internal" href="#id14"><em>build-directory</em></a> <strong>toolset=</strong><a class="reference internal" href="#toolset-name"><em>toolset-name</em></a> <strong>--build-type=complete</strong> stage
 
518
bjam <strong>--build-dir=</strong><a class="reference internal" href="#id13"><em>build-directory</em></a> <strong>toolset=</strong><a class="reference internal" href="#toolset-name"><em>toolset-name</em></a> <strong>--build-type=complete</strong> stage
522
519
</pre>
523
520
<p>For a complete description of these and other invocation options,
524
521
please see the <a class="reference external" href="http://www.boost.org/boost-build2/doc/html/bbv2/advanced/invocation.html">Boost.Build documentation</a>.</p>
525
 
<p>For example, your session might look like this:<a class="footnote-reference" href="#continuation" id="id16"><sup>4</sup></a></p>
 
522
<p>For example, your session might look like this:<a class="footnote-reference" href="#continuation" id="id15"><sup>4</sup></a></p>
526
523
<pre class="literal-block">
527
 
C:\WINDOWS&gt; cd <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt>
528
 
<tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt>&gt; bjam <strong>^</strong>
 
524
C:\WINDOWS&gt; cd <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt>
 
525
<tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt>&gt; bjam <strong>^</strong>
529
526
More? <strong>--build-dir=</strong>&quot;C:\Documents and Settings\dave\build-boost&quot; <strong>^</strong>
530
527
More? <strong>--build-type=complete</strong> <strong>msvc</strong> stage
531
528
</pre>
570
567
</div>
571
568
</div>
572
569
<div class="section" id="expected-build-output">
573
 
<h2><a class="toc-backref" href="#id44">5.4&nbsp;&nbsp;&nbsp;Expected Build Output</a></h2>
 
570
<h2><a class="toc-backref" href="#id43">5.4&nbsp;&nbsp;&nbsp;Expected Build Output</a></h2>
574
571
<p>During the process of building Boost libraries, you can expect to
575
572
see some messages printed on the console.  These may include</p>
576
573
<ul>
594
591
</ul>
595
592
</div>
596
593
<div class="section" id="in-case-of-build-errors">
597
 
<h2><a class="toc-backref" href="#id45">5.5&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></h2>
 
594
<h2><a class="toc-backref" href="#id44">5.5&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></h2>
598
595
<p>The only error messages you see when building Boost—if any—should
599
596
be related to the IOStreams library's support of zip and bzip2
600
597
formats as described <a class="reference external" href="../../libs/iostreams/doc/installation.html">here</a>.  Install the relevant development
611
608
</div>
612
609
</div>
613
610
<div class="section" id="link-your-program-to-a-boost-library">
614
 
<h1><a class="toc-backref" href="#id46">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a></h1>
 
611
<h1><a class="toc-backref" href="#id45">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a></h1>
615
612
<p>To demonstrate linking with a Boost binary library, we'll use the
616
613
following simple program that extracts the subject lines from
617
614
emails.  It uses the <a class="reference external" href="../../libs/regex/index.html">Boost.Regex</a> library, which has a
656
653
variant OSes</a> for the appropriate command-line options to use.</p>
657
654
</div>
658
655
<div class="section" id="link-from-within-the-visual-studio-ide">
659
 
<h2><a class="toc-backref" href="#id47">6.1&nbsp;&nbsp;&nbsp;Link From Within the Visual Studio IDE</a></h2>
 
656
<h2><a class="toc-backref" href="#id46">6.1&nbsp;&nbsp;&nbsp;Link From Within the Visual Studio IDE</a></h2>
660
657
<p>Starting with the <a class="reference internal" href="#vs-header-only">header-only example project</a> we created
661
658
earlier:</p>
662
659
<ol class="arabic simple">
664
661
select <em>Properties</em> from the resulting pop-up menu</li>
665
662
<li>In <em>Configuration Properties</em> &gt; <em>Linker</em> &gt; <em>Additional Library
666
663
Directories</em>, enter the path to the Boost binaries,
667
 
e.g. <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">\lib\</tt>.</li>
 
664
e.g. <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">\lib\</tt>.</li>
668
665
<li>From the <em>Build</em> menu, select <em>Build Solution</em>.</li>
669
666
</ol>
670
667
<p><a class="reference internal" href="#test-your-program"><em>skip to the next step</em></a></p>
671
668
</div>
672
669
<div class="section" id="or-link-from-the-command-prompt">
673
 
<h2><a class="toc-backref" href="#id48">6.2&nbsp;&nbsp;&nbsp;Or, Link From the Command Prompt</a></h2>
 
670
<h2><a class="toc-backref" href="#id47">6.2&nbsp;&nbsp;&nbsp;Or, Link From the Command Prompt</a></h2>
674
671
<p>For example, we can compile and link the above program from the
675
672
Visual C++ command-line by simply adding the <strong>bold</strong> text below to
676
673
the command line we used earlier, assuming your Boost binaries are
677
 
in <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">\lib</tt>:</p>
 
674
in <tt class="docutils literal"><span class="pre">C:\Program</span> Files\boost\</tt><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">\lib</tt>:</p>
678
675
<pre class="literal-block">
679
 
cl /EHsc /I <em>path\to\</em><tt class="docutils literal">boost_1_46_0</tt> example.cpp   <strong>^</strong>
680
 
     <strong>/link /LIBPATH:</strong><strong>C:\Program Files\boost\</strong><strong>boost_1_46_0</strong><strong>\lib</strong>
 
676
cl /EHsc /I <em>path\to\</em><tt class="docutils literal">boost_1_46_1</tt> example.cpp   <strong>^</strong>
 
677
     <strong>/link /LIBPATH:</strong><strong>C:\Program Files\boost\</strong><strong>boost_1_46_1</strong><strong>\lib</strong>
681
678
</pre>
682
679
</div>
683
680
<div class="section" id="library-naming">
684
 
<h2><a class="toc-backref" href="#id49">6.3&nbsp;&nbsp;&nbsp;Library Naming</a></h2>
 
681
<h2><a class="toc-backref" href="#id48">6.3&nbsp;&nbsp;&nbsp;Library Naming</a></h2>
685
682
<div class="note">
686
683
<p class="first admonition-title">Note</p>
687
684
<p>If, like Visual C++, your compiler supports auto-linking,
703
700
<dd><em>Prefix</em>: except on Microsoft Windows, every Boost library
704
701
name begins with this string.  On Windows, only ordinary static
705
702
libraries use the <tt class="docutils literal">lib</tt> prefix; import libraries and DLLs do
706
 
not.<a class="footnote-reference" href="#distinct" id="id24"><sup>6</sup></a></dd>
 
703
not.<a class="footnote-reference" href="#distinct" id="id23"><sup>6</sup></a></dd>
707
704
<dt><tt class="docutils literal">boost_regex</tt></dt>
708
705
<dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal">boost_</tt>.</dd>
709
706
<dt><tt class="docutils literal"><span class="pre">-vc71</span></tt></dt>
746
743
<td>python-debugging=on</td>
747
744
</tr>
748
745
<tr><td><tt class="docutils literal">d</tt></td>
749
 
<td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id25"><sup>7</sup></a></td>
 
746
<td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id24"><sup>7</sup></a></td>
750
747
<td>variant=debug</td>
751
748
</tr>
752
749
<tr><td><tt class="docutils literal">p</tt></td>
784
781
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
785
782
</div>
786
783
<div class="section" id="test-your-program">
787
 
<h2><a class="toc-backref" href="#id50">6.4&nbsp;&nbsp;&nbsp;Test Your Program</a></h2>
 
784
<h2><a class="toc-backref" href="#id49">6.4&nbsp;&nbsp;&nbsp;Test Your Program</a></h2>
788
785
<p>To test our subject extraction, we'll filter the following text
789
786
file.  Copy it out of your browser and save it as <tt class="docutils literal">jayne.txt</tt>:</p>
790
787
<pre class="literal-block">
806
803
</div>
807
804
</div>
808
805
<div class="section" id="conclusion-and-further-resources">
809
 
<h1><a class="toc-backref" href="#id51">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></h1>
 
806
<h1><a class="toc-backref" href="#id50">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></h1>
810
807
<p>This concludes your introduction to Boost and to integrating it
811
808
with your programs.  As you start using Boost in earnest, there are
812
809
surely a few additional points you'll wish we had covered.  One day
817
814
mailing list</a>.</p>
818
815
<ul class="simple">
819
816
<li><a class="reference external" href="../../tools/build/v2/index.html">Boost.Build reference manual</a></li>
820
 
<li><a class="reference external" href="../../tools/build/v2/engine/index.html">Boost.Jam reference manual</a></li>
821
817
<li><a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#users">Boost Users' mailing list</a></li>
822
818
<li><a class="reference external" href="http://www.boost.org/more/mailing_lists.htm#jamboost">Boost.Build mailing list</a></li>
823
 
<li><a class="reference external" href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2">Boost.Build Wiki</a></li>
824
819
<li><a class="reference external" href="../../libs/index.html">Index of all Boost library documentation</a></li>
825
820
</ul>
826
821
<div class="admonition-onward admonition">
835
830
<colgroup><col class="label" /><col /></colgroup>
836
831
<tbody valign="top">
837
832
<tr><td class="label"><a class="fn-backref" href="#id2">[1]</a></td><td>We recommend
838
 
downloading <a class="reference external" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041"><tt class="docutils literal">boost_1_46_0</tt><tt class="docutils literal">.7z</tt></a> and using <a class="reference external" href="http://www.7-zip.org">7-Zip</a> to decompress
 
833
downloading <a class="reference external" href="http://www.boost.org/users/history/version_1_46_1.html"><tt class="docutils literal">boost_1_46_1</tt><tt class="docutils literal">.7z</tt></a> and using <a class="reference external" href="http://www.7-zip.org">7-Zip</a> to decompress
839
834
it.  We no longer recommend .zip files for Boost because they are twice
840
835
as large as the equivalent .7z files.  We don't recommend using Windows'
841
836
built-in decompression as it can be painfully slow for large archives.</td></tr>
863
858
<table class="docutils footnote" frame="void" id="continuation" rules="none">
864
859
<colgroup><col class="label" /><col /></colgroup>
865
860
<tbody valign="top">
866
 
<tr><td class="label"><a class="fn-backref" href="#id16">[4]</a></td><td><p class="first">In this example, the caret character <tt class="docutils literal">^</tt> is a
 
861
<tr><td class="label"><a class="fn-backref" href="#id15">[4]</a></td><td><p class="first">In this example, the caret character <tt class="docutils literal">^</tt> is a
867
862
way of continuing the command on multiple lines, and must be the
868
863
<strong>final character</strong> used on the line to be continued (i.e. do
869
864
not follow it with spaces).  The command prompt responds with
901
896
<table class="docutils footnote" frame="void" id="distinct" rules="none">
902
897
<colgroup><col class="label" /><col /></colgroup>
903
898
<tbody valign="top">
904
 
<tr><td class="label"><a class="fn-backref" href="#id24">[6]</a></td><td>This convention distinguishes the static version of
 
899
<tr><td class="label"><a class="fn-backref" href="#id23">[6]</a></td><td>This convention distinguishes the static version of
905
900
a Boost library from the import library for an
906
901
identically-configured Boost DLL, which would otherwise have the
907
902
same name.</td></tr>
910
905
<table class="docutils footnote" frame="void" id="debug-abi" rules="none">
911
906
<colgroup><col class="label" /><col /></colgroup>
912
907
<tbody valign="top">
913
 
<tr><td class="label"><a class="fn-backref" href="#id25">[7]</a></td><td>These libraries were compiled without optimization
 
908
<tr><td class="label"><a class="fn-backref" href="#id24">[7]</a></td><td>These libraries were compiled without optimization
914
909
or inlining, with full debug symbols enabled, and without
915
910
<tt class="docutils literal">NDEBUG</tt> <tt class="docutils literal">#define</tt>d.  Although it's true that sometimes
916
911
these choices don't affect binary compatibility with other