1
0
mirror of https://github.com/boostorg/more.git synced 2025-03-27 13:50:14 +08:00

Applied 2nd round of reader feedback to Getting Started guide.

Updated BoostCon pages long since live on the website.


[SVN r36362]
This commit is contained in:
Dave Abrahams 2006-12-13 23:49:10 +00:00
parent 7522f8e8e7
commit 5f59ede5a1
5 changed files with 405 additions and 323 deletions

View File

@ -24,12 +24,14 @@ __ ../index.htm
----------
This inaugural Boost conference promises to be the main
face-to-face venue for all things Boost, from using libraries to
writing them, from evangelizing Boost to deployment within your
organization, from infrastructure and process to vision and
mission, and from TR1 to TR2. Given the range and interests of the
participants, the event is going to be intense and in-depth.
.. Admonition:: What is BoostCon?
This inaugural Boost conference promises to be the main
face-to-face venue for all things Boost, from using libraries to
writing them, from evangelizing Boost to deployment within your
organization, from infrastructure and process to vision and
mission, and from TR1 to TR2. Given the range and interests of the
participants, the event is going to be intense and in-depth.
.. contents:: Index
@ -44,21 +46,18 @@ overlap day at midweek. Thus, the conference fosters interaction
both within *and* across these tracks, with an emphasis on service
to our user base.
Sessions will run in the morning and evening, leaving a midday
break of several hours so that attendees can get out and enjoy the
town and its surroundings, or just to have time to work together in
small, informal groups.
Sessions
========
In the spirit of Boost, many sessions will be participatory and/or
collaborative in nature. The program committee has issued a `call
for sessions`_. Please raise any questions about—or ideas for—the
conference on the `Boost mailing lists`__.
collaborative in nature. Sessions will run in the morning and
evening, leaving a midday break of several hours so that attendees
can get out and enjoy the town and its surroundings, or just to
have time to work together in small, informal groups.
.. _call for sessions: http://www.boost.org/more/BoostCon07_session_call.html
__ http://www.boost.org/more/mailing_lists.htm
Propose a Session
=================
See the BoostCon `Call for Sessions`_ for details about how to submit a sesion proposal.
.. _call for Sessions: http://www.boost.org/more/BoostCon07_session_call.html
Venue
=====
@ -94,13 +93,6 @@ us to expand registration should demand prove overwhelming, but
when registration opens we recommend securing your place early, in
case that isn't possible.
Sessions
========
The program committee is currently forming and drafting a call for
sessions; watch this space in upcoming weeks for an outline of
workshop, session, and talk ideas, and a request for submissions.
Registration
============
@ -119,6 +111,14 @@ __ interest_
__ interest_
Questions
=========
Please raise any other questions about—or ideas for—the conference
on the `Boost mailing lists`__.
__ http://www.boost.org/more/mailing_lists.htm
.. _interest: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?BoostCon
Organizing Committee

View File

@ -15,7 +15,7 @@
<h1>Boost Conference 2007:
Call for Proposals</h1>
Call for Sessions</h1>
<p>The first annual Boost conference will take place in Aspen, Colorado, May
14-18, 2007.</p>
<p>This inaugural Boost conference promises to be the main face-to-face
@ -99,12 +99,12 @@
<li>A biography, suitable for the conference web site </li>
<li>Your contact information (will not be made public) </li>
</ul>
<p>Please submit via email to conference@boost-consulting.com, with a
<p>Please submit via email to <a href="mailto:boostcon-program@lists.boost-consulting.com">boostcon-program@lists.boost-consulting.com</a>, with a
subject that begins &quot;BoostCon
proposal&quot; </p>
<hr>
<p>Revised:
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->11 November 2006<!--webbot bot="Timestamp" endspan i-checksum="40199" --></p>
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B %Y" startspan -->4 December 2006<!--webbot bot="Timestamp" endspan i-checksum="40199" --></p>
<p>© Copyright David Abrahams and Beman Dawes 2006</p>
<p>Distributed under the Boost Software License, Version 1.0. (See
accompanying file <a href="http://www.boost.org/LICENSE_1_0.txt">
@ -113,4 +113,4 @@
</p>
</body>
</html>
</html>

View File

@ -4,7 +4,7 @@
import docutils ;
import path ;
sources = getting_started.rst ;
sources = getting_started.rst BoostCon07.rst ;
bases = $(sources:S=) ;
# This is a path relative to the html/ subdirectory where the
@ -15,6 +15,8 @@ for local b in $(bases)
{
html $(b) : $(b).rst :
# <docutils-cmd>"PYTHONPATH=~/src/boost/tools && python ~/src/boost/tools/litre/active-rst.py"
# <docutils-html>"-gdt --writer=html --source-url="./$(b).rst" --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
<docutils-html>"-gdt --source-url="./$(b).rst" --link-stylesheet --traceback --trim-footnote-reference-space --footnote-references=superscript "$(stylesheet)
;
}

View File

@ -14,22 +14,21 @@
<div class="contents sidebar small topic">
<p class="topic-title first"><a id="contents" name="contents">Contents</a></p>
<ul class="auto-toc simple">
<li><a class="reference" href="#introduction" id="id27" name="id27">1&nbsp;&nbsp;&nbsp;Introduction</a><ul class="auto-toc">
<li><a class="reference" href="#what-s-here" id="id28" name="id28">1.1&nbsp;&nbsp;&nbsp;What's Here</a></li>
<li><a class="reference" href="#preliminaries" id="id29" name="id29">1.2&nbsp;&nbsp;&nbsp;Preliminaries</a></li>
<li><a class="reference" href="#introduction" id="id28" name="id28">1&nbsp;&nbsp;&nbsp;Introduction</a><ul class="auto-toc">
<li><a class="reference" href="#what-s-here" id="id29" name="id29">1.1&nbsp;&nbsp;&nbsp;What's Here</a></li>
<li><a class="reference" href="#preliminaries" id="id30" name="id30">1.2&nbsp;&nbsp;&nbsp;Preliminaries</a></li>
</ul>
</li>
<li><a class="reference" href="#get-boost" id="id30" name="id30">2&nbsp;&nbsp;&nbsp;Get Boost</a></li>
<li><a class="reference" href="#the-structure-of-a-boost-distribution" id="id31" name="id31">3&nbsp;&nbsp;&nbsp;The Structure of a Boost Distribution</a></li>
<li><a class="reference" href="#header-only-libraries" id="id32" name="id32">4&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
<li><a class="reference" href="#build-a-simple-program-using-boost" id="id33" name="id33">5&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
<li><a class="reference" href="#build-on-nix" id="id34" name="id34">5.1&nbsp;&nbsp;&nbsp;Build on *nix</a></li>
<li><a class="reference" href="#build-from-the-visual-studio-command-prompt" id="id35" name="id35">5.2&nbsp;&nbsp;&nbsp;Build from the Visual Studio Command Prompt</a></li>
<li><a class="reference" href="#build-in-the-visual-studio-ide" id="id36" name="id36">5.3&nbsp;&nbsp;&nbsp;Build in the Visual Studio IDE</a></li>
<li><a class="reference" href="#errors-and-warnings" id="id37" name="id37">5.4&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
<li><a class="reference" href="#get-boost" id="id31" name="id31">2&nbsp;&nbsp;&nbsp;Get Boost</a></li>
<li><a class="reference" href="#the-structure-of-a-boost-distribution" id="id32" name="id32">3&nbsp;&nbsp;&nbsp;The Structure of a Boost Distribution</a></li>
<li><a class="reference" href="#header-only-libraries" id="id33" name="id33">4&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
<li><a class="reference" href="#build-a-simple-program-using-boost" id="id34" name="id34">5&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
<li><a class="reference" href="#build-on-nix" id="id35" name="id35">5.1&nbsp;&nbsp;&nbsp;Build on *nix</a></li>
<li><a class="reference" href="#build-on-windows" id="id36" name="id36">5.2&nbsp;&nbsp;&nbsp;Build on Windows</a></li>
<li><a class="reference" href="#errors-and-warnings" id="id37" name="id37">5.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
</ul>
</li>
<li><a class="reference" href="#get-boost-library-binaries" id="id38" name="id38">6&nbsp;&nbsp;&nbsp;Get Boost Library Binaries</a><ul class="auto-toc">
<li><a class="reference" href="#prepare-to-use-a-boost-library-binary" id="id38" name="id38">6&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
<li><a class="reference" href="#install-visual-studio-binaries" id="id39" name="id39">6.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></li>
<li><a class="reference" href="#build-and-install-nix-binaries" id="id40" name="id40">6.2&nbsp;&nbsp;&nbsp;Build and Install *nix Binaries</a></li>
<li><a class="reference" href="#build-and-install-other-binaries" id="id41" name="id41">6.3&nbsp;&nbsp;&nbsp;Build and Install Other Binaries</a></li>
@ -39,23 +38,22 @@
</li>
<li><a class="reference" href="#link-your-program-to-a-boost-library" id="id44" name="id44">7&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a><ul class="auto-toc">
<li><a class="reference" href="#link-to-a-boost-library-on-windows" id="id45" name="id45">7.1&nbsp;&nbsp;&nbsp;Link to a Boost Library on Windows</a></li>
<li><a class="reference" href="#link-to-a-boost-library-on-nix" id="id46" name="id46">7.2&nbsp;&nbsp;&nbsp;Link to a Boost Library On *nix</a></li>
<li><a class="reference" href="#link-to-a-boost-library-on-nix" id="id46" name="id46">7.2&nbsp;&nbsp;&nbsp;Link to a Boost Library on *nix</a></li>
<li><a class="reference" href="#library-naming" id="id47" name="id47">7.3&nbsp;&nbsp;&nbsp;Library Naming</a></li>
<li><a class="reference" href="#test-your-program" id="id48" name="id48">7.4&nbsp;&nbsp;&nbsp;Test Your Program</a></li>
</ul>
</li>
<li><a class="reference" href="#conclusion-and-further-resources" id="id49" name="id49">8&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></li>
<li><a class="reference" href="#appendix-using-command-line-tools-in-windows" id="id50" name="id50">9&nbsp;&nbsp;&nbsp;Appendix: Using command-line tools in Windows</a></li>
</ul>
</div>
<!-- ## Update this substitution for each release -->
<div class="section">
<h1><a class="toc-backref" href="#id27" id="introduction" name="introduction">1&nbsp;&nbsp;&nbsp;Introduction</a></h1>
<h1><a class="toc-backref" href="#id28" id="introduction" name="introduction">1&nbsp;&nbsp;&nbsp;Introduction</a></h1>
<p>Welcome to the Boost libraries! By the time you've completed this
tutorial, you'll be at least somewhat comfortable with the contents
of a Boost distribution and how to go about using it.</p>
<div class="section">
<h2><a class="toc-backref" href="#id28" id="what-s-here" name="what-s-here">1.1&nbsp;&nbsp;&nbsp;What's Here</a></h2>
<h2><a class="toc-backref" href="#id29" id="what-s-here" name="what-s-here">1.1&nbsp;&nbsp;&nbsp;What's Here</a></h2>
<p>This document is designed to be an <em>extremely</em> gentle introduction,
so we included a fair amount of material that may already be very
familiar to you. To keep things simple, we also left out some
@ -64,7 +62,7 @@ the end of this document, we'll refer you on to resources that can
help you pursue these topics further.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id29" id="preliminaries" name="preliminaries">1.2&nbsp;&nbsp;&nbsp;Preliminaries</a></h2>
<h2><a class="toc-backref" href="#id30" id="preliminaries" name="preliminaries">1.2&nbsp;&nbsp;&nbsp;Preliminaries</a></h2>
<p>We use one typographic convention that might not be immediately
obvious: <em>italic</em> text in examples is meant as a descriptive
placeholder for something else, usually information that you'll
@ -89,8 +87,8 @@ them for your own compiler or IDE.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id30" id="get-boost" name="get-boost">2&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
<p>There are basically three ways to get Boost on your system:</p>
<h1><a class="toc-backref" href="#id31" id="get-boost" name="get-boost">2&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
<p>To get Boost, choose one of the following methods:</p>
<ol class="arabic">
<li><p class="first"><strong>Windows Installer</strong>: Boost Consulting provides an <a class="reference" href="http://www.boost-consulting.com/download.html">installer</a>
for Windows platforms that installs a complete Boost
@ -98,7 +96,7 @@ distribution, plus optional precompiled library binaries for
Visual Studio, and (optionally) a prebuilt version of the
<tt class="docutils literal"><span class="pre">bjam</span></tt> build tool.</p>
</li>
<li><p class="first"><strong>Download</strong>: users of other platforms—and Windows
<li><p class="first"><strong>Source Download</strong>: users of other platforms—and Windows
users who prefer to build everything from scratch—can <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=376197">download
a complete Boost distribution</a> from SourceForge.</p>
<!-- ## Update this link for each release -->
@ -115,16 +113,18 @@ tar --bzip2 -xf <em>/path/to/</em><tt class="docutils literal"><span class="pre"
</li>
</ul>
</li>
<li><p class="first"><strong>Boost packages</strong> from RedHat, Debian, or some other
distribution packager: these instructions may not work for you
if you use 3rd party packages, because other packagers sometimes
choose to break Boost up into several packages or to reorganize
the directory structure of the Boost distribution.<a class="footnote-reference" href="#packagers" id="id4" name="id4"><sup>2</sup></a></p>
<li><p class="first"><strong>Boost packages</strong> are available from RedHat, Debian, and other
distribution packagers. You may need to adapt these
instructions if you use this method, because other packagers
usually choose to break Boost up into several packages,
reorganize the directory structure of the Boost distribution,
and/or rename the library binaries.<a class="footnote-reference" href="#packagers" id="id4" name="id4"><sup>2</sup></a> If you have
trouble, we suggest going back to method 2.</p>
</li>
</ol>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id31" id="the-structure-of-a-boost-distribution" name="the-structure-of-a-boost-distribution">3&nbsp;&nbsp;&nbsp;The Structure of a Boost Distribution</a></h1>
<h1><a class="toc-backref" href="#id32" id="the-structure-of-a-boost-distribution" name="the-structure-of-a-boost-distribution">3&nbsp;&nbsp;&nbsp;The Structure of a Boost Distribution</a></h1>
<p>This is is a sketch of the directory structure you'll get when you
unpack your Boost installation (windows users replace forward
slashes with backslashes):</p>
@ -159,15 +159,15 @@ the Type Traits Library's <tt class="docutils literal"><span class="pre">is_void
example, <a class="reference" href="../libs/python/index.html">Boost.Python</a>'s aggregate header is
<tt class="docutils literal"><span class="pre">boost/python.hpp</span></tt>.</li>
<li>Most libraries place private headers in a subdirectory called
<tt class="docutils literal"><span class="pre">detail/</span></tt> or <tt class="docutils literal"><span class="pre">aux_/</span></tt>. Don't look in these directories and
expect to find anything you can use.</li>
<tt class="docutils literal"><span class="pre">detail/</span></tt> or <tt class="docutils literal"><span class="pre">aux_/</span></tt>. Don't
expect to find anything you can use in these directories.</li>
</ul>
</div>
<p>A few things are worth noting right off the bat:</p>
<ol class="arabic">
<li><p class="first">The path to the “boost root directory” is sometimes referred to
as <tt class="docutils literal"><span class="pre">$BOOST_ROOT</span></tt> in documentation and mailing lists. If you
used the Windows installer, that will usually be <tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>.</p>
used the Windows installer, that will usually be <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>.</p>
</li>
<li><p class="first">To compile anything in Boost, you need a directory containing
the <tt class="docutils literal"><span class="pre">boost/</span></tt> subdirectory in your <tt class="docutils literal"><span class="pre">#include</span></tt> path. For most
@ -203,40 +203,41 @@ contains a subset of the Boost documentation. Start with
</ol>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id32" id="header-only-libraries" name="header-only-libraries">4&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></h1>
<h1><a class="toc-backref" href="#id33" id="header-only-libraries" name="header-only-libraries">4&nbsp;&nbsp;&nbsp;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">
<p class="first admonition-title">Nothing to Build</p>
<p class="first admonition-title">Nothing to Build?</p>
<p class="last">Most Boost libraries are <strong>header-only</strong>: they consist <em>entirely
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 can't be used without separate
compilation are:</p>
<p id="separate">The only Boost libraries that <em>must</em> be built separately are:</p>
<ul class="simple">
<li>Boost.Filesystem</li>
<li>Boost.IOStreams</li>
<li>Boost.ProgramOptions</li>
<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/index.html">Boost.Python</a></li>
<li>Boost.Regex</li>
<li>Boost.Serialization</li>
<li>Boost.Signals</li>
<li>Boost.Test</li>
<li>Boost.Thread</li>
<li>Boost.Wave</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>
<li><a class="reference" href="../libs/thread/index.html">Boost.Thread</a></li>
<li><a class="reference" href="../libs/wave/index.html">Boost.Wave</a></li>
</ul>
<p>A few libraries have optional separately-compiled binaries:</p>
<ul class="simple">
<li><a class="reference" href="../libs/date_time/index.html">Boost.DateTime</a> has a binary component that is only needed if
you're using its <tt class="docutils literal"><span class="pre">to_string</span></tt>/<tt class="docutils literal"><span class="pre">from_string</span></tt> or serialization
features, or if you're targeting Visual C++ 6.x or Borland.</li>
<li><a class="reference" href="../libs/graph/index.html">Boost.Graph</a> also has a binary component that is only needed if
you intend to <a class="reference" href="../libs/graph/doc/read_graphviz.html">parse GraphViz files</a>.</li>
<li><a class="reference" href="../libs/test/index.html">Boost.Test</a> ... <strong>Waiting for Gennadiy to tell me what to say here.</strong></li>
</ul>
<p>The DateTime library has a separately-compiled component that
is only needed if you're using its to/from_string and/or
serialization features or if you're targeting Visual C++ 6.x or
Borland. The Graph library also has a separately-compiled part,
but you won't need it unless you intend to <a class="reference" href="../libs/graph/doc/read_graphviz.html">parse GraphViz
files</a>.</p>
<!-- ## Keep the list of non-header-only libraries up-to-date -->
</div>
<div class="section">
<h1><a class="toc-backref" href="#id33" id="build-a-simple-program-using-boost" name="build-a-simple-program-using-boost">5&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a></h1>
<h1><a class="toc-backref" href="#id34" id="build-a-simple-program-using-boost" name="build-a-simple-program-using-boost">5&nbsp;&nbsp;&nbsp;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
@ -258,7 +259,7 @@ 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="section">
<h2><a class="toc-backref" href="#id34" id="build-on-nix" name="build-on-nix"><span id="unix-header-only"></span>5.1&nbsp;&nbsp;&nbsp;Build on *nix</a></h2>
<h2><a class="toc-backref" href="#id35" id="build-on-nix" name="build-on-nix"><span id="unix-header-only"></span>5.1&nbsp;&nbsp;&nbsp;Build on *nix</a></h2>
<p>In the directory where you saved <tt class="docutils literal"><span class="pre">example.cpp</span></tt>, issue the
following command:</p>
<pre class="literal-block">
@ -271,7 +272,74 @@ echo 1 2 3 | ./example
<p><a class="reference" href="#errors-and-warnings"><em>next...</em></a></p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id35" id="build-from-the-visual-studio-command-prompt" name="build-from-the-visual-studio-command-prompt">5.2&nbsp;&nbsp;&nbsp;Build from the Visual Studio Command Prompt</a></h2>
<h2><a class="toc-backref" href="#id36" id="build-on-windows" name="build-on-windows">5.2&nbsp;&nbsp;&nbsp;Build on Windows</a></h2>
<div class="small sidebar">
<p class="first sidebar-title"><a id="command-line-tool" name="command-line-tool"><span id="command-prompt"></span>The Windows Command Prompt</a></p>
<p>In Windows, a command-line tool is invoked by typing its name,
optionally followed by arguments, into a <em>Command Prompt</em> window
and pressing the Return (or Enter) key.</p>
<p>To open <em>Command Prompt</em>, click the <em>Start</em> menu button, click
<em>Run</em>, type “cmd”, and then click <em>OK</em>.</p>
<p>All commands are executed within the context of a <strong>current
directory</strong> in the filesystem. To set the current directory,
type:</p>
<pre class="literal-block">
cd <em>path</em>\<em>to</em>\<em>some</em>\<em>directory</em>
</pre>
<p>followed by Return. For example,</p>
<pre class="literal-block">
cd <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
</pre>
<p class="last">Long commands can be continued across several lines by typing a
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>
<p>To build the examples in this guide, you can use an Integrated
Development Environment (IDE) like Visual Studio or you can follow
a shorter path by issuing commands from the command prompt.</p>
<div class="section">
<h3><a id="from-the-visual-studio-ide" name="from-the-visual-studio-ide"><span id="vs-header-only"></span>From the Visual Studio IDE</a></h3>
<ul>
<li><p class="first">From Visual Studio's <em>File</em> menu, select <em>New</em> &gt; <em>Project…</em></p>
</li>
<li><p class="first">In the left-hand pane of the resulting <em>New Project</em> dialog,
select <em>Visual C++</em> &gt; <em>Win32</em>.</p>
</li>
<li><p class="first">In the right-hand pane, select <em>Win32 Console Application</em>
(VS8.0) or <em>Win32 Console Project</em> (VS7.1).</p>
</li>
<li><p class="first">In the <em>name</em> field, enter “example”</p>
</li>
<li><p class="first">Right-click <strong>example</strong> in the <em>Solution Explorer</em> pane and
select <em>Properties</em> from the resulting pop-up menu</p>
</li>
<li><p class="first">In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <em>General</em> &gt; <em>Additional Include
Directories</em>, enter the path to the Boost root directory, for example</p>
<blockquote>
<p><tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt></p>
</blockquote>
</li>
<li><p class="first">In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <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="id8" name="id8"><sup>6</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>
</li>
<li><p class="first">From the <em>Build</em> menu, select <em>Build Solution</em>.</p>
</li>
</ul>
<p>To test your application, hit the F5 key and type the following
into the resulting window, followed by the return key:</p>
<pre class="literal-block">
1 2 3
</pre>
<p>Then hold down the control key and press &quot;Z&quot;, followed by the
return key.</p>
<p><a class="reference" href="#errors-and-warnings"><em>next...</em></a></p>
</div>
<div class="section">
<h3><a id="from-the-command-prompt" name="from-the-command-prompt">From the Command Prompt</a></h3>
<p>From your computer's <em>Start</em> menu, if you are a Visual
Studio 2005 user, select</p>
<blockquote>
@ -285,45 +353,16 @@ Studio 2005 user, select</p>
Studio compiler. In that window, type the following command and
hit the return key:</p>
<pre class="literal-block">
cl /EHsc /I<em>path</em><tt class="docutils literal"><span class="pre">\</span></tt><em>to</em><tt class="docutils literal"><span class="pre">\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> <em>path</em>\<em>to</em>\example.cpp
cl /EHsc /I <em>path</em><tt class="docutils literal"><span class="pre">\</span></tt><em>to</em><tt class="docutils literal"><span class="pre">\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> <em>path</em>\<em>to</em>\example.cpp
</pre>
<p>To test the result, type:</p>
<pre class="literal-block">
echo 1 2 3 | example
</pre>
<p><a class="reference" href="#errors-and-warnings"><em>next...</em></a></p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id36" id="build-in-the-visual-studio-ide" name="build-in-the-visual-studio-ide"><span id="vs-header-only"></span>5.3&nbsp;&nbsp;&nbsp;Build in the Visual Studio IDE</a></h2>
<ul class="simple">
<li>From Visual Studio's <em>File</em> menu, select <em>New</em> &gt; <em>Project…</em></li>
<li>In the left-hand pane of the resulting <em>New Project</em> dialog,
select <em>Visual C++</em> &gt; <em>Win32</em>.</li>
<li>In the right-hand pane, select <em>Win32 Console Application</em>
(VS8.0) or <em>Win32 Console Project</em> (VS7.1).</li>
<li>In the <em>name</em> field, enter “example”</li>
<li>Right-click <strong>example</strong> in the <em>Solution Explorer</em> pane and
select <em>Properties</em> from the resulting pop-up menu</li>
<li>In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <em>General</em> &gt; <em>Additional Include
Directories</em>, enter the path to the Boost root directory, e.g.
<tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>.</li>
<li>In <em>Configuration Properties</em> &gt; <em>C/C++</em> &gt; <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="id9" name="id9"><sup>5</sup></a></li>
<li>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.</li>
<li>From the <em>Build</em> menu, select <em>Build Solution</em>.</li>
</ul>
<p>To test your application, hit the F5 key and type the following
into the resulting window, followed by the return key:</p>
<pre class="literal-block">
1 2 3
</pre>
<p>Then hold down the control key and press &quot;Z&quot;, followed by the
return key.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id37" id="errors-and-warnings" name="errors-and-warnings">5.4&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
<h2><a class="toc-backref" href="#id37" id="errors-and-warnings" name="errors-and-warnings">5.3&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
<p>Don't be alarmed if you see compiler warnings from Boost headers.
We try to eliminate them, but doing so isn't always practical.<a class="footnote-reference" href="#warnings" id="id10" name="id10"><sup>4</sup></a></p>
<p>Errors are another matter. If you're seeing compilation errors at
@ -333,14 +372,14 @@ Boost root directory.</p>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id38" id="get-boost-library-binaries" name="get-boost-library-binaries">6&nbsp;&nbsp;&nbsp;Get Boost Library Binaries</a></h1>
<h1><a class="toc-backref" href="#id38" id="prepare-to-use-a-boost-library-binary" name="prepare-to-use-a-boost-library-binary">6&nbsp;&nbsp;&nbsp;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 library binaries.</p>
<div class="section">
<h2><a class="toc-backref" href="#id39" id="install-visual-studio-binaries" name="install-visual-studio-binaries">6.1&nbsp;&nbsp;&nbsp;Install Visual Studio Binaries</a></h2>
<p>The <a class="reference" href="http://www.boost-consulting.com/download.html">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:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\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>.</p>
the boost root, typically <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><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>.</p>
<p><a class="reference" href="#link-your-program-to-a-boost-library"><em>next...</em></a></p>
</div>
<div class="section">
@ -357,12 +396,14 @@ directory, you'll probably want to at least use</p>
<pre class="literal-block">
<strong>$</strong> ./configure <strong>--prefix=</strong><em>path</em>/<em>to</em>/<em>installation</em>/<em>prefix</em>
</pre>
<p>to install somewhere else. Finally,</p>
<p>to install somewhere else. Also, consider using the
<tt class="docutils literal"><span class="pre">--show-libraries</span></tt> and <tt class="docutils literal"><span class="pre">--with-libraries=</span></tt> options to limit the
long wait you'll experience if you build everything. Finally,</p>
<pre class="literal-block">
<strong>$</strong> make install
</pre>
<p>which will leave Boost binaries in the <tt class="docutils literal"><span class="pre">lib/</span></tt> subdirectory of
your installation prefix. You will also find a copy of the Boost
<p>will leave Boost binaries in the <tt class="docutils literal"><span class="pre">lib/</span></tt> subdirectory of your
installation prefix. You will also find a copy of the Boost
headers in the <tt class="docutils literal"><span class="pre">include/</span></tt> subdirectory of the installation
prefix, so you can henceforth use that directory as an <tt class="docutils literal"><span class="pre">#include</span></tt>
path in place of the Boost root directory.</p>
@ -371,7 +412,7 @@ path in place of the Boost root directory.</p>
<div class="section">
<h2><a class="toc-backref" href="#id41" id="build-and-install-other-binaries" name="build-and-install-other-binaries">6.3&nbsp;&nbsp;&nbsp;Build and Install Other Binaries</a></h2>
<p>If you're not using Visual C++ 7.1 or 8.0, or you're a *nix user
who wants want to build with a toolset other than your system's
who wants to build with a toolset other than your system's
default, or if you want a nonstandard variant build of Boost
(e.g. optimized, but with debug symbols), you'll need to use
<a class="reference" href="../tools/build/index.html">Boost.Build</a> to create your own binaries.</p>
@ -502,20 +543,19 @@ purpose in your current working directory.</p>
<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="#id15"><em>build-directory</em></a> <strong>\</strong>
<strong>--toolset=</strong><a class="reference" href="#toolset-name"><em>toolset-name</em></a> stage
bjam <strong>--build-dir=</strong><a class="reference" href="#id15"><em>build-directory</em></a> <strong>--toolset=</strong><a class="reference" href="#toolset-name"><em>toolset-name</em></a> stage
</pre>
<p>For example, on Windows, your session might look like:</p>
<p>For example, on Windows, your session might look like this:<a class="footnote-reference" href="#continuation" id="id16" name="id16"><sup>5</sup></a></p>
<pre class="literal-block">
C:WINDOWS&gt; cd <tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
<tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>&gt; bjam <strong>\</strong>
<strong>--build-dir=</strong>%TEMP%\build-boost <strong>\</strong>
<strong>--toolset=msvc stage</strong>
C:WINDOWS&gt; cd <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><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:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><span class="pre">Files\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>&gt; bjam <strong>^</strong>
More? <strong>--build-dir=</strong>%TEMP%\build-boost <strong>^</strong>
More? <strong>--toolset=</strong>msvc stage
</pre>
<p>And on Unix:</p>
<pre class="literal-block">
$ cd ~/<tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
$ bjam <strong>--build-dir=</strong>~/build-boost <strong>--prefix=</strong>~/boost
$ bjam <strong>--build-dir=</strong>/tmp/build-boost <strong>--toolset=</strong>gcc
</pre>
<p>In either case, Boost.Build will place the Boost binaries in the
<tt class="docutils literal"><span class="pre">stage/</span></tt> subdirectory of your <a class="reference" href="#build-directory">build directory</a>.</p>
@ -529,6 +569,14 @@ parts shown in <strong>bold</strong> type above be entirely lower-case.</p>
<pre class="literal-block">
bjam --help
</pre>
<p>In particular, to limit the amount of time spent building, you may
be interested in:</p>
<ul class="simple">
<li>reviewing the list of library names with <tt class="docutils literal"><span class="pre">--show-libraries</span></tt></li>
<li>limiting which libraries get built with the <tt class="docutils literal"><span class="pre">--with-</span></tt><em>library-name</em> or <tt class="docutils literal"><span class="pre">--without-</span></tt><em>library-name</em> options</li>
<li>choosing a specific build variant by adding <tt class="docutils literal"><span class="pre">release</span></tt> or
<tt class="docutils literal"><span class="pre">debug</span></tt> to the command line.</li>
</ul>
</div>
</div>
<div class="section">
@ -574,7 +622,7 @@ questions about configuring Boost for your compiler to the
<h1><a class="toc-backref" href="#id44" id="link-your-program-to-a-boost-library" name="link-your-program-to-a-boost-library">7&nbsp;&nbsp;&nbsp;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">Boost.Regex</a> library, which has a
emails. It uses the <a class="reference" href="../libs/regex/index.html">Boost.Regex</a> library, which has a
separately-compiled binary component.</p>
<pre class="literal-block">
#include &lt;boost/regex.hpp&gt;
@ -603,12 +651,6 @@ build settings.</li>
whose compile configuration is compatible with the rest of your
project.</li>
</ol>
<div class="note">
<p class="first admonition-title">Note</p>
<p class="last"><a class="reference" href="../libs/python/index.html">Boost.Python</a> users should read that library's own <a class="reference" href="../libs/python/doc/building.html">build
documentation</a> as there are several library-specific issues to
consider.</p>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id45" id="link-to-a-boost-library-on-windows" name="link-to-a-boost-library-on-windows">7.1&nbsp;&nbsp;&nbsp;Link to a Boost Library on Windows</a></h2>
<p id="auto-linking">Most Windows compilers and linkers have so-called “auto-linking
@ -622,7 +664,7 @@ the directories you've told it to search.</p>
<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
in <tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\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>:</p>
in <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><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>:</p>
<pre class="literal-block">
cl /EHsc /I <em>path</em><tt class="docutils literal"><span class="pre">\</span></tt><em>to</em><tt class="docutils literal"><span class="pre">\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> example.cpp <strong>\</strong>
<strong>/link /LIBPATH:</strong> <strong>C:\Program Files\boost\</strong><strong>boost_1_34_0</strong><strong>\lib</strong>
@ -638,14 +680,14 @@ earlier:</p>
select <em>Properties</em> from the resulting pop-up menu</li>
<li>In <em>Configuration Properties</em> &gt; <em>Linker</em> &gt; <em>Additional Library
Directories</em>, enter the path to the Boost binaries,
e.g. <tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\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>.</li>
e.g. <tt class="docutils literal"><span class="pre">C:\</span></tt><tt class="docutils literal"><span class="pre">Program</span></tt> <tt class="docutils literal"><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>.</li>
<li>From the <em>Build</em> menu, select <em>Build Solution</em>.</li>
</ol>
<p><a class="reference" href="#test-your-program"><em>next...</em></a></p>
</div>
</div>
<div class="section">
<h2><a class="toc-backref" href="#id46" id="link-to-a-boost-library-on-nix" name="link-to-a-boost-library-on-nix">7.2&nbsp;&nbsp;&nbsp;Link to a Boost Library On *nix</a></h2>
<h2><a class="toc-backref" href="#id46" id="link-to-a-boost-library-on-nix" name="link-to-a-boost-library-on-nix">7.2&nbsp;&nbsp;&nbsp;Link to a Boost Library on *nix</a></h2>
<p>There are two main ways to link to libraries:</p>
<ol class="upperalpha">
<li><p class="first">You can specify the full path to each library:</p>
@ -654,7 +696,7 @@ $ c++ -I <tt class="docutils literal"><span class="pre">/</span></tt><em>path</e
<strong>~/boost/lib/libboost_regex-gcc-3.4-mt-d-1_34.a</strong>
</pre>
</li>
<li><p class="first">You can separately specify a directory to search (with <tt class="docutils literal"><span class="pre">-L</span></tt><em>directory</em>) and a library name to search for (with <tt class="docutils literal"><span class="pre">-l</span></tt><em>library</em>,<a class="footnote-reference" href="#lowercase-l" id="id21" name="id21"><sup>6</sup></a> dropping the filename's leading <tt class="docutils literal"><span class="pre">lib</span></tt> and trailing
<li><p class="first">You can separately specify a directory to search (with <tt class="docutils literal"><span class="pre">-L</span></tt><em>directory</em>) and a library name to search for (with <tt class="docutils literal"><span class="pre">-l</span></tt><em>library</em>,<a class="footnote-reference" href="#lowercase-l" id="id21" name="id21"><sup>7</sup></a> dropping the filename's leading <tt class="docutils literal"><span class="pre">lib</span></tt> and trailing
suffix (<tt class="docutils literal"><span class="pre">.a</span></tt> in this case):</p>
<pre class="literal-block">
$ c++ -I <tt class="docutils literal"><span class="pre">/</span></tt><em>path</em><tt class="docutils literal"><span class="pre">/</span></tt><em>to</em><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> example.cpp -o example <strong>\</strong>
@ -685,7 +727,7 @@ 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="id23" name="id23"><sup>7</sup></a></dd>
not.<a class="footnote-reference" href="#distinct" id="id23" name="id23"><sup>8</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>
@ -722,14 +764,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="id24" name="id24"><sup>8</sup></a></td>
<td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id24" name="id24"><sup>9</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="id25" name="id25"><sup>9</sup></a></td>
<td>using STLPort's deprecated “native iostreams” feature.<a class="footnote-reference" href="#native" id="id25" name="id25"><sup>10</sup></a></td>
</tr>
</tbody>
</table>
@ -744,16 +786,16 @@ ABI tag is ommitted.</p>
replaced by underscores. For example, version 1.31.1 would be
tagged as &quot;-1_31_1&quot;.</dd>
<dt><tt class="docutils literal"><span class="pre">.lib</span></tt></dt>
<dd><em>Extension</em>: determined according to the
operating system's usual convention. On most *nix 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—except for libraries built
by <tt class="docutils literal"><span class="pre">gcc</span></tt> toolset, which always uses the *nix
convention—``.dll`` indicates a shared library and <tt class="docutils literal"><span class="pre">.lib</span></tt>
indicates a static or import library. Where supported by *nix
toolsets, a full version extension is added (e.g. &quot;.so.1.34&quot;); a
symbolic link to the library file, named without the trailing
version number, will also be created.</dd>
<dd><em>Extension</em>: determined according to the operating system's usual
convention. On most *nix 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 <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> <span class="pre">``.lib</span></tt> indicates a static or import
library. Where supported by *nix toolsets, a full version
extension is added (e.g. &quot;.so.1.34&quot;) and a symbolic link to the
library file, named without the trailing version number, will
also be created.</dd>
</dl>
</div>
<div class="section">
@ -815,12 +857,30 @@ them. Until then, we suggest you pursue the following resources.
If you can't find what you need, or there's anything we can do to
make this document clearer, please post it to the <a class="reference" href="mailing_lists.htm#users">Boost Users'
mailing list</a>.</p>
<ul class="simple">
<li><a class="reference" href="../tools/build/v2">Boost.Build reference manual</a></li>
<li><a class="reference" href="../tools/jam/index.html">Boost.Jam reference manual</a></li>
<li><a class="reference" href="mailing_lists.htm#users">Boost Users' mailing list</a></li>
<li><a class="reference" href="mailing_lists.htm#jamboost">Boost.Build mailing list</a></li>
<li><a class="reference" href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2">Boost.Build Wiki</a></li>
<ul>
<li><p class="first"><a class="reference" href="../tools/build/v2">Boost.Build reference manual</a></p>
</li>
<li><p class="first"><a class="reference" href="../tools/jam/index.html">Boost.Jam reference manual</a></p>
</li>
<li><p class="first"><a class="reference" href="mailing_lists.htm#users">Boost Users' mailing list</a></p>
</li>
<li><p class="first"><a class="reference" href="mailing_lists.htm#jamboost">Boost.Build mailing list</a></p>
</li>
<li><p class="first"><a class="reference" href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2">Boost.Build Wiki</a></p>
</li>
<li><p class="first">Index of <a class="reference" href="../libs/index.html">All Library Documentation</a></p>
</li>
<li><p class="first">Library-specific Configuration and Build Details</p>
<ul>
<li><p class="first"><a class="reference" href="../libs/python/doc/building.html">Boost.Python</a></p>
<blockquote>
</blockquote>
</li>
<li><p class="first"><strong>Library authors need to send me the links for their
libraries</strong></p>
</li>
</ul>
</li>
</ul>
<div class="admonition-onward admonition">
<p class="first admonition-title">Onward</p>
@ -829,33 +889,6 @@ mailing list</a>.</p>
<p class="attribution">&mdash;the Boost Developers</p>
</blockquote>
</div>
</div>
<div class="section">
<h1><a class="toc-backref" href="#id50" id="appendix-using-command-line-tools-in-windows" name="appendix-using-command-line-tools-in-windows"><span id="command-line-tool"></span><span id="command-prompt"></span><span id="using-command-line-tools-in-windows"></span>9&nbsp;&nbsp;&nbsp;Appendix: Using command-line tools in Windows</a></h1>
<p>In Windows, a command-line tool is invoked by typing its name,
optionally followed by arguments, into a <em>Command Prompt</em> window
and pressing the Return (or Enter) key.</p>
<p>To open <em>Command Prompt</em>, click the <em>Start</em> menu button, click
<em>Run</em>, type “cmd”, and then click OK.</p>
<p>All commands are executed within the context of a <strong>current
directory</strong> in the filesystem. To set the current directory,
type:</p>
<pre class="literal-block">
cd <em>path</em>\<em>to</em>\<em>some</em>\<em>directory</em>
</pre>
<p>followed by Return. For example,</p>
<pre class="literal-block">
cd <tt class="docutils literal"><span class="pre">C:</span></tt> <tt class="docutils literal"><span class="pre">\Program</span></tt>`` <tt class="docutils literal"><span class="pre">\</span> <span class="pre">``Files</span></tt><tt class="docutils literal"><span class="pre">\boost\</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
</pre>
<p>One way to name a directory you know about is to write</p>
<pre class="literal-block">
%HOMEDRIVE%%HOMEPATH%\<em>directory-name</em>
</pre>
<p>which indicates a sibling folder of your “My Documents” folder.</p>
<p>Long commands can be continued across several lines by typing
backslashes at the ends of all but the last line. Many of the
examples on this page use that technique to save horizontal
space.</p>
<hr class="docutils" />
<table class="docutils footnote" frame="void" id="zip" rules="none">
<colgroup><col class="label" /><col /></colgroup>
@ -896,10 +929,20 @@ where it's not worth the trouble. Finally, some compilers don't
have any source code mechanism for suppressing warnings.</td></tr>
</tbody>
</table>
<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="#id16" name="continuation">[5]</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
the example would fit on a page of reasonable width.</td></tr>
</tbody>
</table>
<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="#id9" name="pch">[5]</a></td><td>There's no problem using Boost with precompiled headers;
<tr><td class="label"><a class="fn-backref" href="#id8" name="pch">[6]</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>
@ -908,14 +951,14 @@ used in the examples.</td></tr>
<table class="docutils footnote" frame="void" id="lowercase-l" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id21" name="lowercase-l">[6]</a></td><td>That option is a dash followed by a lowercase “L”
<tr><td class="label"><a class="fn-backref" href="#id21" name="lowercase-l">[7]</a></td><td>That option is a dash followed by a lowercase “L”
character, which looks very much like a numeral 1 in some fonts.</td></tr>
</tbody>
</table>
<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="#id23" name="distinct">[7]</a></td><td>This convention distinguishes the static version of
<tr><td class="label"><a class="fn-backref" href="#id23" name="distinct">[8]</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>
@ -924,7 +967,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="#id24" name="debug-abi">[8]</a></td><td>These libraries were compiled without optimization
<tr><td class="label"><a class="fn-backref" href="#id24" name="debug-abi">[9]</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. All though it's true that sometimes
these choices don't affect binary compatibility with other
@ -934,7 +977,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="#id25" name="native">[9]</a></td><td>This feature of STLPort is deprecated because it's
<tr><td class="label"><a class="fn-backref" href="#id25" name="native">[10]</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>
@ -944,7 +987,7 @@ recommend it.</td></tr>
<div class="footer">
<hr class="footer" />
<a class="reference" href="./getting_started.rst">View document source</a>.
Generated on: 2006-12-12 00:28 UTC.
Generated on: 2006-12-13 23:45 UTC.
Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>

View File

@ -23,7 +23,7 @@ __ ../index.htm
.. |root| replace:: ``/``\ *path*\ ``/``\ *to*\ ``/``\ |boost_ver|
.. |winroot| replace:: *path*\ ``\``\ *to*\ ``\``\ |boost_ver|
.. |winroot-default| replace:: ``C:\Program``\ `` ``\ ``Files\boost\``\ |boost_ver|
.. |winroot-default| replace:: ``C:\``\ ``Program`` ``Files\boost\``\ |boost_ver|
.. |bold-winroot-default| replace:: **C:\\Program Files\\boost\\**\ |boost_ver-bold|
Introduction
@ -31,7 +31,7 @@ Introduction
Welcome to the Boost libraries! By the time you've completed this
tutorial, you'll be at least somewhat comfortable with the contents
of a Boost distribution and how to go about using it.
of a Boost distribution and how to go about using it.
What's Here
-----------
@ -75,7 +75,7 @@ them for your own compiler or IDE.
Get Boost
=========
There are basically three ways to get Boost on your system:
To get Boost, choose one of the following methods:
1. **Windows Installer**: Boost Consulting provides an installer_
for Windows platforms that installs a complete Boost
@ -89,7 +89,7 @@ There are basically three ways to get Boost on your system:
.. _installer: `Windows installer`_
2. **Download**: users of other platforms—and Windows
2. **Source Download**: users of other platforms—and Windows
users who prefer to build everything from scratch—can `download
a complete Boost distribution`__ from SourceForge.
@ -107,11 +107,13 @@ There are basically three ways to get Boost on your system:
tar --bzip2 -xf */path/to/*\ |boost_ver|\ .tar.bz2
3. **Boost packages** from RedHat, Debian, or some other
distribution packager: these instructions may not work for you
if you use 3rd party packages, because other packagers sometimes
choose to break Boost up into several packages or to reorganize
the directory structure of the Boost distribution. [#packagers]_
3. **Boost packages** are available from RedHat, Debian, and other
distribution packagers. You may need to adapt these
instructions if you use this method, because other packagers
usually choose to break Boost up into several packages,
reorganize the directory structure of the Boost distribution,
and/or rename the library binaries. [#packagers]_ If you have
trouble, we suggest going back to method 2.
The Structure of a Boost Distribution
=====================================
@ -156,8 +158,8 @@ slashes with backslashes):
``boost/python.hpp``.
* Most libraries place private headers in a subdirectory called
``detail/`` or ``aux_/``. Don't look in these directories and
expect to find anything you can use.
``detail/`` or ``aux_/``. Don't
expect to find anything you can use in these directories.
A few things are worth noting right off the bat:
@ -206,7 +208,7 @@ Header-Only Libraries
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.
.. admonition:: Nothing to Build
.. admonition:: Nothing to Build?
Most Boost libraries are **header-only**: they consist *entirely
of header files* containing templates and inline functions, and
@ -215,26 +217,28 @@ Boost?” The good news is that often, there's nothing to build.
.. _separate:
The only Boost libraries that can't be used without separate
compilation are:
The only Boost libraries that *must* be built separately are:
* Boost.Filesystem
* Boost.IOStreams
* Boost.ProgramOptions
* Boost.Filesystem_
* Boost.IOStreams_
* Boost.ProgramOptions_
* Boost.Python_
* Boost.Regex
* Boost.Serialization
* Boost.Signals
* Boost.Test
* Boost.Thread
* Boost.Wave
* Boost.Regex_
* Boost.Serialization_
* Boost.Signals_
* Boost.Thread_
* Boost.Wave_
The DateTime library has a separately-compiled component that
is only needed if you're using its to/from_string and/or
serialization features or if you're targeting Visual C++ 6.x or
Borland. The Graph library also has a separately-compiled part,
but you won't need it unless you intend to `parse GraphViz
files`__.
A few libraries have optional separately-compiled binaries:
* Boost.DateTime_ has a binary component that is only needed if
you're using its ``to_string``\ /\ ``from_string`` or serialization
features, or if you're targeting Visual C++ 6.x or Borland.
* Boost.Graph_ also has a binary component that is only needed if
you intend to `parse GraphViz files`__.
* Boost.Test_ ... **Waiting for Gennadiy to tell me what to say here.**
__ ../libs/graph/doc/read_graphviz.html
@ -288,8 +292,84 @@ To test the result, type:
__ `Errors and Warnings`_
Build from the Visual Studio Command Prompt
-------------------------------------------
Build on Windows
----------------
.. _`command prompt`:
.. _`command-line tool`:
.. sidebar:: The Windows Command Prompt
:class: small
In Windows, a command-line tool is invoked by typing its name,
optionally followed by arguments, into a *Command Prompt* window
and pressing the Return (or Enter) key.
To open *Command Prompt*, click the *Start* menu button, click
*Run*, type “cmd”, and then click *OK*.
All commands are executed within the context of a **current
directory** in the filesystem. To set the current directory,
type:
.. parsed-literal::
cd *path*\ \\\ *to*\ \\\ *some*\ \\\ *directory*
followed by Return. For example,
.. parsed-literal::
cd |winroot-default|
Long commands can be continued across several lines by typing a
caret (``^``) at the end of all but the last line. Some examples
on this page use that technique to save horizontal space.
To build the examples in this guide, you can use an Integrated
Development Environment (IDE) like Visual Studio or you can follow
a shorter path by issuing commands from the command prompt.
.. _vs-header-only:
From the Visual Studio IDE
..........................
* From Visual Studio's *File* menu, select *New* > *Project…*
* In the left-hand pane of the resulting *New Project* dialog,
select *Visual C++* > *Win32*.
* In the right-hand pane, select *Win32 Console Application*
(VS8.0) or *Win32 Console Project* (VS7.1).
* In the *name* field, enter “example”
* Right-click **example** in the *Solution Explorer* pane and
select *Properties* from the resulting pop-up menu
* In *Configuration Properties* > *C/C++* > *General* > *Additional Include
Directories*, enter the path to the Boost root directory, for example
|winroot-default|
* In *Configuration Properties* > *C/C++* > *Precompiled Headers*, change
*Use Precompiled Header (/Yu)* to *Not Using Precompiled
Headers*. [#pch]_
* Replace the contents of the ``example.cpp`` generated by the IDE
with the example code above.
* From the *Build* menu, select *Build Solution*.
To test your application, hit the F5 key and type the following
into the resulting window, followed by the return key::
1 2 3
Then hold down the control key and press "Z", followed by the
return key.
|next|__
__ `Errors and Warnings`_
From the Command Prompt
.......................
From your computer's *Start* menu, if you are a Visual
Studio 2005 user, select
@ -308,7 +388,7 @@ hit the return key:
.. parsed-literal::
cl /EHsc /I\ |winroot| *path*\ \\\ *to*\ \\example.cpp
cl /EHsc /I |winroot| *path*\ \\\ *to*\ \\example.cpp
To test the result, type:
@ -316,41 +396,6 @@ To test the result, type:
echo 1 2 3 | example
|next|__
__ `Errors and Warnings`_
.. _vs-header-only:
Build in the Visual Studio IDE
------------------------------
* From Visual Studio's *File* menu, select *New* > *Project…*
* In the left-hand pane of the resulting *New Project* dialog,
select *Visual C++* > *Win32*.
* In the right-hand pane, select *Win32 Console Application*
(VS8.0) or *Win32 Console Project* (VS7.1).
* In the *name* field, enter “example”
* Right-click **example** in the *Solution Explorer* pane and
select *Properties* from the resulting pop-up menu
* In *Configuration Properties* > *C/C++* > *General* > *Additional Include
Directories*, enter the path to the Boost root directory, e.g.
|winroot-default|.
* In *Configuration Properties* > *C/C++* > *Precompiled Headers*, change
*Use Precompiled Header (/Yu)* to *Not Using Precompiled
Headers*. [#pch]_
* Replace the contents of the ``example.cpp`` generated by the IDE
with the example code above.
* From the *Build* menu, select *Build Solution*.
To test your application, hit the F5 key and type the following
into the resulting window, followed by the return key::
1 2 3
Then hold down the control key and press "Z", followed by the
return key.
Errors and Warnings
-------------------
@ -363,8 +408,8 @@ this point in the tutorial, check to be sure you've copied the
example program correctly and that you've correctly identified the
Boost root directory.
Get Boost Library Binaries
==========================
Prepare to Use a Boost Library Binary
=====================================
If you want to use any of the separately-compiled Boost libraries,
you'll need library binaries.
@ -399,14 +444,16 @@ directory, you'll probably want to at least use
**$** ./configure **--prefix=**\ *path*\ /\ *to*\ /\ *installation*\ /\ *prefix*
to install somewhere else. Finally,
to install somewhere else. Also, consider using the
``--show-libraries`` and ``--with-libraries=`` options to limit the
long wait you'll experience if you build everything. Finally,
.. parsed-literal::
**$** make install
which will leave Boost binaries in the ``lib/`` subdirectory of
your installation prefix. You will also find a copy of the Boost
will leave Boost binaries in the ``lib/`` subdirectory of your
installation prefix. You will also find a copy of the Boost
headers in the ``include/`` subdirectory of the installation
prefix, so you can henceforth use that directory as an ``#include``
path in place of the Boost root directory.
@ -419,7 +466,7 @@ Build and Install Other Binaries
--------------------------------
If you're not using Visual C++ 7.1 or 8.0, or you're a \*nix user
who wants want to build with a toolset other than your system's
who wants to build with a toolset other than your system's
default, or if you want a nonstandard variant build of Boost
(e.g. optimized, but with debug symbols), you'll need to use
Boost.Build_ to create your own binaries.
@ -542,24 +589,23 @@ invoke ``bjam`` as follows:
.. parsed-literal::
bjam **--build-dir=**\ |build-directory|_ **\\**
**--toolset=**\ |toolset-name|_ stage
bjam **--build-dir=**\ |build-directory|_ **--toolset=**\ |toolset-name|_ stage
For example, on Windows, your session might look like:
For example, on Windows, your session might look like this: [#continuation]_
.. parsed-literal::
C:\WINDOWS> cd |winroot-default|
|winroot-default|> bjam **\\**
**--build-dir=**\ %TEMP%\\build-boost **\\**
**--toolset=msvc stage**
|winroot-default|> bjam **^**
More? **--build-dir=**\ %TEMP%\\build-boost **^**
More? **--toolset=**\ msvc stage
And on Unix:
.. parsed-literal::
$ cd ~/|boost_ver|
$ bjam **--build-dir=**\ ~/build-boost **--prefix=**\ ~/boost
$ bjam **--build-dir=**\ /tmp/build-boost **--toolset=**\ gcc
In either case, Boost.Build will place the Boost binaries in the
``stage/`` subdirectory of your `build directory`_.
@ -572,6 +618,17 @@ For a description of other options you can pass when invoking
bjam --help
In particular, to limit the amount of time spent building, you may
be interested in:
* reviewing the list of library names with ``--show-libraries``
* limiting which libraries get built with the ``--with-``\
*library-name* or ``--without-``\ *library-name* options
* choosing a specific build variant by adding ``release`` or
``debug`` to the command line.
Expected Build Output
---------------------
@ -640,8 +697,6 @@ separately-compiled binary component. ::
}
}
.. _Boost.Regex: ../libs/regex
There are two main challenges associated with linking:
1. Tool configuration, e.g. choosing command-line options or IDE
@ -651,13 +706,6 @@ There are two main challenges associated with linking:
whose compile configuration is compatible with the rest of your
project.
.. Note:: Boost.Python_ users should read that library's own `build
documentation`__ as there are several library-specific issues to
consider.
.. _Boost.Python: ../libs/python/index.html
__ ../libs/python/doc/building.html
Link to a Boost Library on Windows
----------------------------------
@ -706,7 +754,7 @@ __ vs-header-only_
__ `Test Your Program`_
Link to a Boost Library On \*nix
Link to a Boost Library on \*nix
--------------------------------
There are two main ways to link to libraries:
@ -895,6 +943,19 @@ mailing list`_.
* `Boost Users' mailing list`_
* `Boost.Build mailing list`_
* `Boost.Build Wiki`_
* Index of `All Library Documentation`_
* Library-specific Configuration and Build Details
- Boost.Python__
__ ../libs/python/doc/building.html
- **Library authors need to send me the links for their
libraries**
.. _All Library Documentation: ../libs/index.html
.. Admonition:: Onward
@ -910,48 +971,6 @@ mailing list`_.
.. _Boost.Build Wiki: http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2
.. _Boost.Build mailing list: mailing_lists.htm#jamboost
.. _`Using command-line tools in Windows`:
.. _`command prompt`:
.. _`command-line tool`:
Appendix: Using command-line tools in Windows
=============================================
In Windows, a command-line tool is invoked by typing its name,
optionally followed by arguments, into a *Command Prompt* window
and pressing the Return (or Enter) key.
To open *Command Prompt*, click the *Start* menu button, click
*Run*, type “cmd”, and then click OK.
All commands are executed within the context of a **current
directory** in the filesystem. To set the current directory,
type:
.. parsed-literal::
cd *path*\ \\\ *to*\ \\\ *some*\ \\\ *directory*
followed by Return. For example,
.. parsed-literal::
cd |winroot-default|
One way to name a directory you know about is to write
.. parsed-literal::
%HOMEDRIVE%%HOMEPATH%\\\ *directory-name*
which indicates a sibling folder of your “My Documents” folder.
Long commands can be continued across several lines by typing
backslashes at the ends of all but the last line. Many of the
examples on this page use that technique to save horizontal
space.
------------------------------
.. [#zip] If you prefer not to download executable programs, download
@ -979,6 +998,12 @@ space.
where it's not worth the trouble. Finally, some compilers don't
have any source code mechanism for suppressing warnings.
.. [#continuation] In this example, the caret character ``^`` is a
way of continuing the command on multiple lines. The command
prompt responds with ``More?`` to prompt for more input. Feel
free to omit the carets and subsequent newlines; we used them so
the example would fit on a page of reasonable width.
.. [#pch] 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
@ -1002,3 +1027,15 @@ space.
impossible to make it work transparently to the user; we don't
recommend it.
.. _Boost.DateTime: ../libs/date_time/index.html
.. _Boost.Filesystem: ../libs/filesystem/index.html
.. _Boost.Graph: ../libs/graph/index.html
.. _Boost.IOStreams: ../libs/iostreams/index.html
.. _Boost.ProgramOptions: ../libs/program_options/index.html
.. _Boost.Python: ../libs/python/index.html
.. _Boost.Regex: ../libs/regex/index.html
.. _Boost.Serialization: ../libs/serialization/index.html
.. _Boost.Signals: ../libs/signals/index.html
.. _Boost.Test: ../libs/test/index.html
.. _Boost.Thread: ../libs/thread/index.html
.. _Boost.Wave: ../libs/wave/index.html