unix-variants.html 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786
  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
  7. <title>Boost Getting Started on Unix Variants</title>
  8. <meta content="Getting Started with Boost on Unix Variants (including Linux and MacOS)" name="description" />
  9. <link rel="stylesheet" href="../../rst.css" type="text/css" />
  10. </head>
  11. <body>
  12. <div class="document" id="logo-getting-started-on-unix-variants">
  13. <h1 class="title"><a class="reference" href="../../index.htm"><img alt="Boost" class="boost-logo" src="../../boost.png" /></a> Getting Started on Unix Variants</h1>
  14. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  15. <!-- Software License, Version 1.0. (See accompanying -->
  16. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  17. <!-- maybe we don't need this
  18. .. Admonition:: A note to Cygwin_ and MinGW_ users
  19. If you plan to build from the Cygwin_ bash shell, you're in the
  20. right place. If you plan to use your tools from the Windows
  21. command prompt, you should follow the instructions for `getting
  22. started on Windows`_. Other command shells, such as MinGW_\ 's
  23. MSYS, are not supported—they may or may not work.
  24. .. _`Getting Started on Windows`: windows.html
  25. .. _Cygwin: http://www.cygwin.com
  26. .. _MinGW: http://mingw.org -->
  27. <div class="contents topic">
  28. <p class="topic-title first"><a id="index" name="index">Index</a></p>
  29. <ul class="auto-toc simple">
  30. <li><a class="reference" href="#get-boost" id="id17" name="id17">1&nbsp;&nbsp;&nbsp;Get Boost</a></li>
  31. <li><a class="reference" href="#the-boost-distribution" id="id18" name="id18">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></li>
  32. <li><a class="reference" href="#header-only-libraries" id="id19" name="id19">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></li>
  33. <li><a class="reference" href="#build-a-simple-program-using-boost" id="id20" name="id20">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a><ul class="auto-toc">
  34. <li><a class="reference" href="#errors-and-warnings" id="id21" name="id21">4.1&nbsp;&nbsp;&nbsp;Errors and Warnings</a></li>
  35. </ul>
  36. </li>
  37. <li><a class="reference" href="#prepare-to-use-a-boost-library-binary" id="id22" name="id22">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a><ul class="auto-toc">
  38. <li><a class="reference" href="#easy-build-and-install" id="id23" name="id23">5.1&nbsp;&nbsp;&nbsp;Easy Build and Install</a></li>
  39. <li><a class="reference" href="#or-custom-build-and-install" id="id24" name="id24">5.2&nbsp;&nbsp;&nbsp;Or, Custom Build and Install</a><ul class="auto-toc">
  40. <li><a class="reference" href="#get-bjam" id="id25" name="id25">5.2.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
  41. <li><a class="reference" href="#identify-your-toolset" id="id26" name="id26">5.2.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></li>
  42. <li><a class="reference" href="#select-a-build-directory" id="id27" name="id27">5.2.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></li>
  43. <li><a class="reference" href="#invoke-bjam" id="id28" name="id28">5.2.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></li>
  44. </ul>
  45. </li>
  46. <li><a class="reference" href="#expected-build-output" id="id29" name="id29">5.3&nbsp;&nbsp;&nbsp;Expected Build Output</a></li>
  47. <li><a class="reference" href="#in-case-of-build-errors" id="id30" name="id30">5.4&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></li>
  48. </ul>
  49. </li>
  50. <li><a class="reference" href="#link-your-program-to-a-boost-library" id="id31" name="id31">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a><ul class="auto-toc">
  51. <li><a class="reference" href="#library-naming" id="id32" name="id32">6.1&nbsp;&nbsp;&nbsp;Library Naming</a></li>
  52. <li><a class="reference" href="#test-your-program" id="id33" name="id33">6.2&nbsp;&nbsp;&nbsp;Test Your Program</a></li>
  53. </ul>
  54. </li>
  55. <li><a class="reference" href="#conclusion-and-further-resources" id="id34" name="id34">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></li>
  56. </ul>
  57. </div>
  58. <div class="section">
  59. <h1><a class="toc-backref" href="#id17" id="get-boost" name="get-boost">1&nbsp;&nbsp;&nbsp;Get Boost</a></h1>
  60. <p>The most reliable way to get a copy of Boost is to download a
  61. distribution from <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=376197">SourceForge</a>:</p>
  62. <ol class="arabic">
  63. <li><p class="first">Download <tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt><tt class="docutils literal"><span class="pre">.tar.bz2</span></tt>.</p>
  64. </li>
  65. <li><p class="first">In the directory where you want to put the Boost installation,
  66. execute</p>
  67. <pre class="literal-block">
  68. tar --bzip2 -xf <em>/path/to/</em><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>.tar.bz2
  69. </pre>
  70. </li>
  71. </ol>
  72. <div class="admonition-other-packages admonition">
  73. <p class="first admonition-title">Other Packages</p>
  74. <p class="last">RedHat, Debian, and other distribution packagers supply Boost
  75. library packages, however you may need to adapt these
  76. instructions if you use third-party packages, because their
  77. creators usually choose to break Boost up into several packages,
  78. reorganize the directory structure of the Boost distribution,
  79. and/or rename the library binaries.<a class="footnote-reference" href="#packagers" id="id2" name="id2"><sup>1</sup></a> If you have
  80. any trouble, we suggest using an official Boost distribution
  81. from <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=376197">SourceForge</a>.</p>
  82. </div>
  83. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  84. <!-- Software License, Version 1.0. (See accompanying -->
  85. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  86. </div>
  87. <div class="section">
  88. <h1><a class="toc-backref" href="#id18" id="the-boost-distribution" name="the-boost-distribution">2&nbsp;&nbsp;&nbsp;The Boost Distribution</a></h1>
  89. <p>This is a sketch of the resulting directory structure:</p>
  90. <pre class="literal-block">
  91. <strong>boost_1_34_0</strong><strong>/</strong> .................<em>The “boost root directory”</em>
  92. <strong>index.htm</strong> .........<em>A copy of www.boost.org starts here</em>
  93. <strong>boost</strong><strong>/</strong> .........................<em>All Boost Header files</em>
  94. <tt class="docutils literal"> </tt>
  95. <strong>libs</strong><strong>/</strong> ............<em>Tests, .cpp</em>s<em>, docs, etc., by library</em>
  96. <strong>index.html</strong> ........<em>Library documentation starts here</em>
  97. <strong>algorithm</strong><strong>/</strong>
  98. <strong>any</strong><strong>/</strong>
  99. <strong>array</strong><strong>/</strong>
  100. <em>…more libraries…</em>
  101. <strong>status</strong><strong>/</strong> .........................<em>Boost-wide test suite</em>
  102. <strong>tools</strong><strong>/</strong> ...........<em>Utilities, e.g. bjam, quickbook, bcp</em>
  103. <strong>more</strong><strong>/</strong> ..........................<em>Policy documents, etc.</em>
  104. <strong>doc</strong><strong>/</strong> ...............<em>A subset of all Boost library docs</em>
  105. </pre>
  106. <div class="sidebar">
  107. <p class="first sidebar-title">Header Organization</p>
  108. <p class="pre-wrap">The organization of Boost library headers isn't entirely uniform,
  109. but most libraries follow a few patterns:</p>
  110. <ul class="pre-wrap last">
  111. <li><p class="first">Some older libraries and most very small libraries place all
  112. public headers directly into <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>.</p>
  113. </li>
  114. <li><p class="first">Most libraries' public headers live in a subdirectory of
  115. <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>, named after the library. For example, you'll find
  116. the Python library's <tt class="docutils literal"><span class="pre">def.hpp</span></tt> header in</p>
  117. <pre class="literal-block">
  118. <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">python</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">def.hpp</span></tt>.
  119. </pre>
  120. </li>
  121. <li><p class="first">Some libraries have an “aggregate header” in <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> that
  122. <tt class="docutils literal"><span class="pre">#include</span></tt>s all of the library's other headers. For
  123. example, <a class="reference" href="../../libs/python/doc/building.html">Boost.Python</a>'s aggregate header is</p>
  124. <pre class="literal-block">
  125. <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">python.hpp</span></tt>.
  126. </pre>
  127. </li>
  128. <li><p class="first">Most libraries place private headers in a subdirectory called
  129. <tt class="docutils literal"><span class="pre">detail</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>, or <tt class="docutils literal"><span class="pre">aux_</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>. Don't expect to find
  130. anything you can use in these directories.</p>
  131. </li>
  132. </ul>
  133. </div>
  134. <p>It's important to note the following:</p>
  135. <ol class="arabic" id="boost-root-directory">
  136. <li><p class="first">The path to the <strong>boost root directory</strong> (often <tt class="docutils literal"><span class="pre">/usr/local/</span></tt><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>) is
  137. sometimes referred to as <tt class="docutils literal"><span class="pre">$BOOST_ROOT</span></tt> in documentation and
  138. mailing lists .</p>
  139. </li>
  140. <li><p class="first">To compile anything in Boost, you need a directory containing
  141. the <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory in your <tt class="docutils literal"><span class="pre">#include</span></tt> path. <tt class="docutils literal"> </tt></p>
  142. </li>
  143. <li><p class="first">Since all of Boost's header files have the <tt class="docutils literal"><span class="pre">.hpp</span></tt> extension,
  144. and live in the <tt class="docutils literal"><span class="pre">boost</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory of the boost root, your
  145. Boost <tt class="docutils literal"><span class="pre">#include</span></tt> directives will look like:</p>
  146. <pre class="literal-block">
  147. #include &lt;boost/<em>whatever</em>.hpp&gt;
  148. </pre>
  149. <p>or</p>
  150. <pre class="literal-block">
  151. #include &quot;boost/<em>whatever</em>.hpp&quot;
  152. </pre>
  153. <p>depending on your preference regarding the use of angle bracket
  154. includes. <tt class="docutils literal"> </tt></p>
  155. </li>
  156. <li><p class="first">Don't be distracted by the <tt class="docutils literal"><span class="pre">doc</span></tt><tt class="docutils literal"><span class="pre">/</span></tt> subdirectory; it only
  157. contains a subset of the Boost documentation. Start with
  158. <tt class="docutils literal"><span class="pre">libs</span></tt><tt class="docutils literal"><span class="pre">/</span></tt><tt class="docutils literal"><span class="pre">index.html</span></tt> if you're looking for the whole enchilada.</p>
  159. </li>
  160. </ol>
  161. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  162. <!-- Software License, Version 1.0. (See accompanying -->
  163. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  164. </div>
  165. <div class="section">
  166. <h1><a class="toc-backref" href="#id19" id="header-only-libraries" name="header-only-libraries">3&nbsp;&nbsp;&nbsp;Header-Only Libraries</a></h1>
  167. <p>The first thing many people want to know is, “how do I build
  168. Boost?” The good news is that often, there's nothing to build.</p>
  169. <div class="admonition-nothing-to-build admonition">
  170. <p class="first admonition-title">Nothing to Build?</p>
  171. <p class="last">Most Boost libraries are <strong>header-only</strong>: they consist <em>entirely
  172. of header files</em> containing templates and inline functions, and
  173. require no separately-compiled library binaries or special
  174. treatment when linking.</p>
  175. </div>
  176. <p id="separate">The only Boost libraries that <em>must</em> be built separately are:</p>
  177. <ul class="simple">
  178. <li><a class="reference" href="../../libs/filesystem/index.html">Boost.Filesystem</a></li>
  179. <li><a class="reference" href="../../libs/iostreams/index.html">Boost.IOStreams</a></li>
  180. <li><a class="reference" href="../../libs/program_options/index.html">Boost.ProgramOptions</a></li>
  181. <li><a class="reference" href="../../libs/python/doc/building.html">Boost.Python</a></li>
  182. <li><a class="reference" href="../../libs/regex/index.html">Boost.Regex</a></li>
  183. <li><a class="reference" href="../../libs/serialization/index.html">Boost.Serialization</a></li>
  184. <li><a class="reference" href="../../libs/signals/index.html">Boost.Signals</a></li>
  185. <li><a class="reference" href="../../libs/thread/index.html">Boost.Thread</a></li>
  186. <li><a class="reference" href="../../libs/wave/index.html">Boost.Wave</a></li>
  187. </ul>
  188. <p>A few libraries have optional separately-compiled binaries:</p>
  189. <ul class="simple">
  190. <li><a class="reference" href="../../libs/date_time/index.html">Boost.DateTime</a> has a binary component that is only needed if
  191. 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
  192. features, or if you're targeting Visual C++ 6.x or Borland.</li>
  193. <li><a class="reference" href="../../libs/graph/index.html">Boost.Graph</a> also has a binary component that is only needed if
  194. you intend to <a class="reference" href="../../libs/graph/doc/read_graphviz.html">parse GraphViz files</a>.</li>
  195. <li><a class="reference" href="../../libs/test/index.html">Boost.Test</a> can be used in “header-only” or “separately compiled”
  196. mode, although <strong>separate compilation is recommended for serious
  197. use</strong>.</li>
  198. </ul>
  199. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  200. <!-- Software License, Version 1.0. (See accompanying -->
  201. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  202. </div>
  203. <div class="section">
  204. <h1><a class="toc-backref" href="#id20" id="build-a-simple-program-using-boost" name="build-a-simple-program-using-boost">4&nbsp;&nbsp;&nbsp;Build a Simple Program Using Boost</a></h1>
  205. <p>To keep things simple, let's start by using a header-only library.
  206. The following program reads a sequence of integers from standard
  207. input, uses Boost.Lambda to multiply each number by three, and
  208. writes them to standard output:</p>
  209. <pre class="literal-block">
  210. #include &lt;boost/lambda/lambda.hpp&gt;
  211. #include &lt;iostream&gt;
  212. #include &lt;iterator&gt;
  213. #include &lt;algorithm&gt;
  214. int main()
  215. {
  216. using namespace boost::lambda;
  217. typedef std::istream_iterator&lt;int&gt; in;
  218. std::for_each(
  219. in(std::cin), in(), std::cout &lt;&lt; (_1 * 3) &lt;&lt; &quot; &quot; );
  220. }
  221. </pre>
  222. <p>Copy the text of this program into a file called <tt class="docutils literal"><span class="pre">example.cpp</span></tt>.</p>
  223. <p>Now, in the directory where you saved <tt class="docutils literal"><span class="pre">example.cpp</span></tt>, issue the
  224. following command:</p>
  225. <pre class="literal-block">
  226. c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> example.cpp -o example
  227. </pre>
  228. <p>To test the result, type:</p>
  229. <pre class="literal-block">
  230. echo 1 2 3 | ./example
  231. </pre>
  232. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  233. <!-- Software License, Version 1.0. (See accompanying -->
  234. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  235. <div class="section">
  236. <h2><a class="toc-backref" href="#id21" id="errors-and-warnings" name="errors-and-warnings">4.1&nbsp;&nbsp;&nbsp;Errors and Warnings</a></h2>
  237. <p>Don't be alarmed if you see compiler warnings originating in Boost
  238. headers. We try to eliminate them, but doing so isn't always
  239. practical.<a class="footnote-reference" href="#warnings" id="id4" name="id4"><sup>3</sup></a> <strong>Errors are another matter</strong>. If you're
  240. seeing compilation errors at this point in the tutorial, check to
  241. be sure you've copied the <a class="reference" href="#build-a-simple-program-using-boost">example program</a> correctly and that you've
  242. correctly identified the <a class="reference" href="#boost-root-directory">Boost root directory</a>.</p>
  243. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  244. <!-- Software License, Version 1.0. (See accompanying -->
  245. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  246. </div>
  247. </div>
  248. <div class="section">
  249. <h1><a class="toc-backref" href="#id22" id="prepare-to-use-a-boost-library-binary" name="prepare-to-use-a-boost-library-binary">5&nbsp;&nbsp;&nbsp;Prepare to Use a Boost Library Binary</a></h1>
  250. <p>If you want to use any of the separately-compiled Boost libraries,
  251. you'll need to acquire library binaries.</p>
  252. <div class="section">
  253. <h2><a class="toc-backref" href="#id23" id="easy-build-and-install" name="easy-build-and-install">5.1&nbsp;&nbsp;&nbsp;Easy Build and Install</a></h2>
  254. <p>Issue the following commands in the shell (don't type <tt class="docutils literal"><span class="pre">$</span></tt>; that
  255. represents the shell's prompt):</p>
  256. <pre class="literal-block">
  257. <strong>$</strong> cd <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
  258. <strong>$</strong> ./configure --help
  259. </pre>
  260. <p>Select your configuration options and invoke <tt class="docutils literal"><span class="pre">./configure</span></tt> again
  261. without the <tt class="docutils literal"><span class="pre">--help</span></tt> option. Unless you have write permission in
  262. your system's <tt class="docutils literal"><span class="pre">/usr/local/</span></tt> directory, you'll probably want to at
  263. least use</p>
  264. <pre class="literal-block">
  265. <strong>$</strong> ./configure <strong>--prefix=</strong><em>path</em>/<em>to</em>/<em>installation</em>/<em>prefix</em>
  266. </pre>
  267. <p>to install somewhere else. Also, consider using the
  268. <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
  269. long wait you'll experience if you build everything. Finally,</p>
  270. <pre class="literal-block">
  271. <strong>$</strong> make install
  272. </pre>
  273. <p>will leave Boost binaries in the <tt class="docutils literal"><span class="pre">lib/</span></tt> subdirectory of your
  274. installation prefix. You will also find a copy of the Boost
  275. headers in the <tt class="docutils literal"><span class="pre">include/</span></tt> subdirectory of the installation
  276. prefix, so you can henceforth use that directory as an <tt class="docutils literal"><span class="pre">#include</span></tt>
  277. path in place of the Boost root directory.</p>
  278. <p><a class="reference" href="#link-your-program-to-a-boost-library"><em>skip to the next step</em></a></p>
  279. </div>
  280. <div class="section">
  281. <h2><a class="toc-backref" href="#id24" id="or-custom-build-and-install" name="or-custom-build-and-install">5.2&nbsp;&nbsp;&nbsp;Or, Custom Build and Install</a></h2>
  282. <p>If you're using a compiler other than your system's default, you'll
  283. need to use <a class="reference" href="../../tools/build/index.html">Boost.Build</a> to create binaries. You'll also
  284. use this method if you need a nonstandard build variant (see the
  285. <a class="reference" href="../../tools/build/index.html">Boost.Build documentation</a> for more details).</p>
  286. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  287. <!-- Software License, Version 1.0. (See accompanying -->
  288. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  289. <p><a class="reference" href="../../tools/build/index.html">Boost.Build</a> is a text-based system for developing, testing, and
  290. installing software. To use it, you'll need an executable called
  291. <tt class="docutils literal"><span class="pre">bjam</span></tt>.</p>
  292. <div class="section">
  293. <h3><a class="toc-backref" href="#id25" id="get-bjam" name="get-bjam">5.2.1&nbsp;&nbsp;&nbsp;Get <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
  294. <p><tt class="docutils literal"><span class="pre">bjam</span></tt> is the command-line tool that drives the Boost Build
  295. system. To build Boost binaries, you'll invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> from the
  296. Boost root.</p>
  297. <p>Boost provides <a class="reference" href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=72941">pre-compiled <tt class="docutils literal"><span class="pre">bjam</span></tt> executables</a> for a variety of platforms.
  298. Alternatively, you can build <tt class="docutils literal"><span class="pre">bjam</span></tt> yourself using <a class="reference" href="../../doc/html/jam/building.html">these
  299. instructions</a>.</p>
  300. </div>
  301. <div class="section">
  302. <h3><a class="toc-backref" href="#id26" id="identify-your-toolset" name="identify-your-toolset"><span id="toolset-name"></span><span id="toolset"></span>5.2.2&nbsp;&nbsp;&nbsp;Identify Your Toolset</a></h3>
  303. <p>First, find the toolset corresponding to your compiler in the
  304. following table.</p>
  305. <table border="1" class="docutils table">
  306. <colgroup>
  307. <col width="18%" />
  308. <col width="33%" />
  309. <col width="48%" />
  310. </colgroup>
  311. <thead valign="bottom">
  312. <tr><th class="head">Toolset
  313. Name</th>
  314. <th class="head">Vendor</th>
  315. <th class="head">Notes</th>
  316. </tr>
  317. </thead>
  318. <tbody valign="top">
  319. <tr><td><tt class="docutils literal"><span class="pre">acc</span></tt></td>
  320. <td>Hewlett Packard</td>
  321. <td>Only very recent versions are
  322. known to work well with Boost</td>
  323. </tr>
  324. <tr><td><tt class="docutils literal"><span class="pre">borland</span></tt></td>
  325. <td>Borland</td>
  326. <td>&nbsp;</td>
  327. </tr>
  328. <tr><td><tt class="docutils literal"><span class="pre">como</span></tt></td>
  329. <td>Comeau Computing</td>
  330. <td>Using this toolset may
  331. require <a class="reference" href="../../tools/build/index.html">configuring</a> another
  332. toolset to act as its backend</td>
  333. </tr>
  334. <tr><td><tt class="docutils literal"><span class="pre">cw</span></tt></td>
  335. <td>Metrowerks/FreeScale</td>
  336. <td>The CodeWarrior compiler. We
  337. have not tested versions of
  338. this compiler produced since
  339. it was sold to FreeScale.</td>
  340. </tr>
  341. <tr><td><tt class="docutils literal"><span class="pre">dmc</span></tt></td>
  342. <td>Digital Mars</td>
  343. <td>As of this Boost release, no
  344. version of dmc is known to
  345. handle Boost well.</td>
  346. </tr>
  347. <tr><td><tt class="docutils literal"><span class="pre">darwin</span></tt></td>
  348. <td>Apple Computer</td>
  349. <td>Apple's version of the GCC
  350. toolchain with support for
  351. Darwin and MacOS X features
  352. such as frameworks.</td>
  353. </tr>
  354. <tr><td><tt class="docutils literal"><span class="pre">gcc</span></tt></td>
  355. <td>The Gnu Project</td>
  356. <td>Includes support for Cygwin
  357. and MinGW compilers.</td>
  358. </tr>
  359. <tr><td><tt class="docutils literal"><span class="pre">hp_cxx</span></tt></td>
  360. <td>Hewlett Packard</td>
  361. <td>Targeted at the Tru64
  362. operating system.</td>
  363. </tr>
  364. <tr><td><tt class="docutils literal"><span class="pre">intel</span></tt></td>
  365. <td>Intel</td>
  366. <td>&nbsp;</td>
  367. </tr>
  368. <tr><td><tt class="docutils literal"><span class="pre">kylix</span></tt></td>
  369. <td>Borland</td>
  370. <td>&nbsp;</td>
  371. </tr>
  372. <tr><td><tt class="docutils literal"><span class="pre">msvc</span></tt></td>
  373. <td>Microsoft</td>
  374. <td>&nbsp;</td>
  375. </tr>
  376. <tr><td><tt class="docutils literal"><span class="pre">qcc</span></tt></td>
  377. <td>QNX Software Systems</td>
  378. <td>&nbsp;</td>
  379. </tr>
  380. <tr><td><tt class="docutils literal"><span class="pre">sun</span></tt></td>
  381. <td>Sun</td>
  382. <td>Only very recent versions are
  383. known to work well with
  384. Boost.</td>
  385. </tr>
  386. <tr><td><tt class="docutils literal"><span class="pre">vacpp</span></tt></td>
  387. <td>IBM</td>
  388. <td>The VisualAge C++ compiler.</td>
  389. </tr>
  390. </tbody>
  391. </table>
  392. <p>If you have multiple versions of a particular compiler installed,
  393. you can append the version number to the toolset name, preceded by a
  394. hyphen, e.g. <tt class="docutils literal"><span class="pre">msvc-7.1</span></tt> or <tt class="docutils literal"><span class="pre">gcc-3.4</span></tt>.</p>
  395. <div class="note">
  396. <p class="first admonition-title">Note</p>
  397. <p class="last">if you built <tt class="docutils literal"><span class="pre">bjam</span></tt> yourself, you may
  398. have selected a toolset name for that purpose, but that does not
  399. affect this step in any way; you still need to select a Boost.Build
  400. toolset from the table.</p>
  401. </div>
  402. </div>
  403. <div class="section">
  404. <h3><a class="toc-backref" href="#id27" id="select-a-build-directory" name="select-a-build-directory"><span id="id9"></span><span id="build-directory"></span>5.2.3&nbsp;&nbsp;&nbsp;Select a Build Directory</a></h3>
  405. <p><a class="reference" href="../../tools/build/index.html">Boost.Build</a> will place all intermediate files it generates while
  406. building into the <strong>build directory</strong>. If your Boost root
  407. directory is writable, this step isn't strictly necessary: by
  408. default Boost.Build will create a <tt class="docutils literal"><span class="pre">bin.v2/</span></tt> subdirectory for that
  409. purpose in your current working directory.</p>
  410. </div>
  411. <div class="section">
  412. <h3><a class="toc-backref" href="#id28" id="invoke-bjam" name="invoke-bjam">5.2.4&nbsp;&nbsp;&nbsp;Invoke <tt class="docutils literal"><span class="pre">bjam</span></tt></a></h3>
  413. <p>Change your current directory to the Boost root directory and
  414. invoke <tt class="docutils literal"><span class="pre">bjam</span></tt> as follows:</p>
  415. <pre class="literal-block">
  416. bjam <strong>--build-dir=</strong><a class="reference" href="#id9"><em>build-directory</em></a> <strong>--toolset=</strong><a class="reference" href="#toolset-name"><em>toolset-name</em></a> stage
  417. </pre>
  418. <p>For example, your session might look like this:</p>
  419. <pre class="literal-block">
  420. $ cd ~/<tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt>
  421. $ bjam <strong>--build-dir=</strong>/tmp/build-boost <strong>--toolset=</strong>gcc
  422. </pre>
  423. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  424. <!-- Software License, Version 1.0. (See accompanying -->
  425. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  426. <p>Boost.Build will place the Boost binaries in the <tt class="docutils literal"><span class="pre">stage</span></tt><tt class="docutils literal"><span class="pre">/</span></tt>
  427. subdirectory of your <a class="reference" href="#build-directory">build directory</a>.</p>
  428. <div class="note">
  429. <p class="first admonition-title">Note</p>
  430. <p class="last"><tt class="docutils literal"><span class="pre">bjam</span></tt> is case-sensitive; it is important that all the
  431. parts shown in <strong>bold</strong> type above be entirely lower-case.</p>
  432. </div>
  433. <p>For a description of other options you can pass when invoking
  434. <tt class="docutils literal"><span class="pre">bjam</span></tt>, type:</p>
  435. <pre class="literal-block">
  436. bjam --help
  437. </pre>
  438. <p>In particular, to limit the amount of time spent building, you may
  439. be interested in:</p>
  440. <ul class="simple">
  441. <li>reviewing the list of library names with <tt class="docutils literal"><span class="pre">--show-libraries</span></tt></li>
  442. <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>
  443. <li>choosing a specific build variant by adding <tt class="docutils literal"><span class="pre">release</span></tt> or
  444. <tt class="docutils literal"><span class="pre">debug</span></tt> to the command line.</li>
  445. </ul>
  446. </div>
  447. </div>
  448. <div class="section">
  449. <h2><a class="toc-backref" href="#id29" id="expected-build-output" name="expected-build-output">5.3&nbsp;&nbsp;&nbsp;Expected Build Output</a></h2>
  450. <p>During the process of building Boost libraries, you can expect to
  451. see some messages printed on the console. These may include</p>
  452. <ul>
  453. <li><p class="first">Notices about Boost library configuration—for example, the Regex
  454. library outputs a message about ICU when built without Unicode
  455. support, and the Python library may be skipped without error (but
  456. with a notice) if you don't have Python installed.</p>
  457. </li>
  458. <li><p class="first">Messages from the build tool that report the number of targets
  459. that were built or skipped. Don't be surprised if those numbers
  460. don't make any sense to you; there are many targets per library.</p>
  461. </li>
  462. <li><p class="first">Build action messages describing what the tool is doing, which
  463. look something like:</p>
  464. <pre class="literal-block">
  465. <em>toolset-name</em>.c++ <em>long</em>/<em>path</em>/<em>to</em>/<em>file</em>/<em>being</em>/<em>built</em>
  466. </pre>
  467. </li>
  468. <li><p class="first">Compiler warnings.</p>
  469. </li>
  470. </ul>
  471. </div>
  472. <div class="section">
  473. <h2><a class="toc-backref" href="#id30" id="in-case-of-build-errors" name="in-case-of-build-errors">5.4&nbsp;&nbsp;&nbsp;In Case of Build Errors</a></h2>
  474. <p>The only error messages you see when building Boost—if any—should
  475. be related to the IOStreams library's support of zip and bzip2
  476. formats as described <a class="reference" href="../../libs/iostreams/doc/installation.html">here</a>. Install the relevant development
  477. packages for libz and libbz2 if you need those features. Other
  478. errors when building Boost libraries are cause for concern.</p>
  479. <p>If it seems like the build system can't find your compiler and/or
  480. linker, consider setting up a <tt class="docutils literal"><span class="pre">user-config.jam</span></tt> file as described
  481. in the <a class="reference" href="../../tools/build/index.html">Boost.Build documentation</a>. If that isn't your problem or
  482. the <tt class="docutils literal"><span class="pre">user-config.jam</span></tt> file doesn't work for you, please address
  483. questions about configuring Boost for your compiler to the
  484. <a class="reference" href="../../more/mailing_lists.htm#jamboost">Boost.Build mailing list</a>.</p>
  485. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  486. <!-- Software License, Version 1.0. (See accompanying -->
  487. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  488. </div>
  489. </div>
  490. <div class="section">
  491. <h1><a class="toc-backref" href="#id31" id="link-your-program-to-a-boost-library" name="link-your-program-to-a-boost-library">6&nbsp;&nbsp;&nbsp;Link Your Program to a Boost Library</a></h1>
  492. <p>To demonstrate linking with a Boost binary library, we'll use the
  493. following simple program that extracts the subject lines from
  494. emails. It uses the <a class="reference" href="../../libs/regex/index.html">Boost.Regex</a> library, which has a
  495. separately-compiled binary component.</p>
  496. <pre class="literal-block">
  497. #include &lt;boost/regex.hpp&gt;
  498. #include &lt;iostream&gt;
  499. #include &lt;string&gt;
  500. int main()
  501. {
  502. std::string line;
  503. boost::regex pat( &quot;^Subject: (Re: |Aw: )*(.*)&quot; );
  504. while (std::cin)
  505. {
  506. std::getline(std::cin, line);
  507. boost::smatch matches;
  508. if (boost::regex_match(line, matches, pat))
  509. std::cout &lt;&lt; matches[2] &lt;&lt; std::endl;
  510. }
  511. }
  512. </pre>
  513. <p>There are two main challenges associated with linking:</p>
  514. <ol class="arabic simple">
  515. <li>Tool configuration, e.g. choosing command-line options or IDE
  516. build settings.</li>
  517. <li>Identifying the library binary, among all the build variants,
  518. whose compile configuration is compatible with the rest of your
  519. project.</li>
  520. </ol>
  521. <p>There are two main ways to link to libraries:</p>
  522. <ol class="upperalpha">
  523. <li><p class="first">You can specify the full path to each library:</p>
  524. <pre class="literal-block">
  525. $ c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> example.cpp -o example <strong>\</strong>
  526. <strong>~/boost/lib/libboost_regex-gcc-3.4-mt-d-1_34.a</strong>
  527. </pre>
  528. </li>
  529. <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="id11" name="id11"><sup>2</sup></a> dropping the filename's leading <tt class="docutils literal"><span class="pre">lib</span></tt> and trailing
  530. suffix (<tt class="docutils literal"><span class="pre">.a</span></tt> in this case):</p>
  531. <pre class="literal-block">
  532. $ c++ -I <em>path/to/</em><tt class="docutils literal"><span class="pre">boost_1_34_0</span></tt> example.cpp -o example <strong>\</strong>
  533. <strong>-L~/boost/lib/ -lboost_regex-gcc-3.4-mt-d-1_34</strong>
  534. </pre>
  535. <p>As you can see, this method is just as terse as method A for one
  536. library; it <em>really</em> pays off when you're using multiple
  537. libraries from the same directory. Note, however, that if you
  538. use this method with a library that has both static (<tt class="docutils literal"><span class="pre">.a</span></tt>) and
  539. dynamic (<tt class="docutils literal"><span class="pre">.so</span></tt>) builds, the system may choose one
  540. automatically for you unless you pass a special option such as
  541. <tt class="docutils literal"><span class="pre">-static</span></tt> on the command line.</p>
  542. </li>
  543. </ol>
  544. <p>In both cases above, the bold text is what you'd add to <a class="reference" href="#build-a-simple-program-using-boost">the
  545. command lines we explored earlier</a>.</p>
  546. <div class="section">
  547. <h2><a class="toc-backref" href="#id32" id="library-naming" name="library-naming">6.1&nbsp;&nbsp;&nbsp;Library Naming</a></h2>
  548. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  549. <!-- Software License, Version 1.0. (See accompanying -->
  550. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  551. <p>In order to choose the right binary for your build configuration
  552. you need to know how Boost binaries are named. Each library
  553. filename is composed of a common sequence of elements that describe
  554. how it was built. For example,
  555. <tt class="docutils literal"><span class="pre">libboost_regex-vc71-mt-d-1_34.lib</span></tt> can be broken down into the
  556. following elements:</p>
  557. <dl class="docutils">
  558. <dt><tt class="docutils literal"><span class="pre">lib</span></tt></dt>
  559. <dd><em>Prefix</em>: except on Microsoft Windows, every Boost library
  560. name begins with this string. On Windows, only ordinary static
  561. libraries use the <tt class="docutils literal"><span class="pre">lib</span></tt> prefix; import libraries and DLLs do
  562. not.<a class="footnote-reference" href="#distinct" id="id13" name="id13"><sup>4</sup></a></dd>
  563. <dt><tt class="docutils literal"><span class="pre">boost_regex</span></tt></dt>
  564. <dd><em>Library name</em>: all boost library filenames begin with <tt class="docutils literal"><span class="pre">boost_</span></tt>.</dd>
  565. <dt><tt class="docutils literal"><span class="pre">-vc71</span></tt></dt>
  566. <dd><em>Toolset tag</em>: identifies the toolset and version used to build
  567. the binary.</dd>
  568. <dt><tt class="docutils literal"><span class="pre">-mt</span></tt></dt>
  569. <dd><em>Threading tag</em>: indicates that the library was
  570. built with multithreading support enabled. Libraries built
  571. without multithreading support can be identified by the absence
  572. of <tt class="docutils literal"><span class="pre">-mt</span></tt>.</dd>
  573. <dt><tt class="docutils literal"><span class="pre">-d</span></tt></dt>
  574. <dd><p class="first"><em>ABI tag</em>: encodes details that affect the library's
  575. interoperability with other compiled code. For each such
  576. feature, a single letter is added to the tag:</p>
  577. <blockquote>
  578. <table border="1" class="docutils table">
  579. <colgroup>
  580. <col width="6%" />
  581. <col width="94%" />
  582. </colgroup>
  583. <thead valign="bottom">
  584. <tr><th class="head">Key</th>
  585. <th class="head">Use this library when:</th>
  586. </tr>
  587. </thead>
  588. <tbody valign="top">
  589. <tr><td><tt class="docutils literal"><span class="pre">s</span></tt></td>
  590. <td>linking statically to the C++ standard library and compiler runtime support
  591. libraries.</td>
  592. </tr>
  593. <tr><td><tt class="docutils literal"><span class="pre">g</span></tt></td>
  594. <td>using debug versions of the standard and runtime support libraries.</td>
  595. </tr>
  596. <tr><td><tt class="docutils literal"><span class="pre">y</span></tt></td>
  597. <td>using a special <a class="reference" href="../../libs/python/doc/building.html#variants">debug build of Python</a>.</td>
  598. </tr>
  599. <tr><td><tt class="docutils literal"><span class="pre">d</span></tt></td>
  600. <td>building a debug version of your code.<a class="footnote-reference" href="#debug-abi" id="id14" name="id14"><sup>5</sup></a></td>
  601. </tr>
  602. <tr><td><tt class="docutils literal"><span class="pre">p</span></tt></td>
  603. <td>using the STLPort standard library rather than the default one supplied with
  604. your compiler.</td>
  605. </tr>
  606. <tr><td><tt class="docutils literal"><span class="pre">n</span></tt></td>
  607. <td>using STLPort's deprecated “native iostreams” feature.<a class="footnote-reference" href="#native" id="id15" name="id15"><sup>6</sup></a></td>
  608. </tr>
  609. </tbody>
  610. </table>
  611. </blockquote>
  612. <p class="last">For example, if you build a debug version of your code for use
  613. with debug versions of the static runtime library and the
  614. STLPort standard library in “native iostreams” mode,
  615. the tag would be: <tt class="docutils literal"><span class="pre">-sgdpn</span></tt>. If none of the above apply, the
  616. ABI tag is ommitted.</p>
  617. </dd>
  618. <dt><tt class="docutils literal"><span class="pre">-1_34</span></tt></dt>
  619. <dd><em>Version tag</em>: the full Boost release number, with periods
  620. replaced by underscores. For example, version 1.31.1 would be
  621. tagged as &quot;-1_31_1&quot;.</dd>
  622. <dt><tt class="docutils literal"><span class="pre">.lib</span></tt></dt>
  623. <dd><em>Extension</em>: determined according to the operating system's usual
  624. convention. On most unix-style platforms the extensions are
  625. <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
  626. libraries, respectively. On Windows, <tt class="docutils literal"><span class="pre">.dll</span></tt> indicates a shared
  627. library and (except for static libraries built by the <tt class="docutils literal"><span class="pre">gcc</span></tt>
  628. toolset, whose names always end in <tt class="docutils literal"><span class="pre">.a</span></tt>) <tt class="docutils literal"><span class="pre">.lib</span></tt> indicates a
  629. static or import library. Where supported by toolsets on unix
  630. variants, a full version extension is added (e.g. &quot;.so.1.34&quot;) and
  631. a symbolic link to the library file, named without the trailing
  632. version number, will also be created.</dd>
  633. </dl>
  634. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  635. <!-- Software License, Version 1.0. (See accompanying -->
  636. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  637. </div>
  638. <div class="section">
  639. <h2><a class="toc-backref" href="#id33" id="test-your-program" name="test-your-program">6.2&nbsp;&nbsp;&nbsp;Test Your Program</a></h2>
  640. <p>To test our subject extraction, we'll filter the following text
  641. file. Copy it out of your browser and save it as <tt class="docutils literal"><span class="pre">jayne.txt</span></tt>:</p>
  642. <pre class="literal-block">
  643. To: George Shmidlap
  644. From: Rita Marlowe
  645. Subject: Will Success Spoil Rock Hunter?
  646. ---
  647. See subject.
  648. </pre>
  649. <p>If you linked to a shared library, you may need to prepare some
  650. platform-specific settings so that the system will be able to find
  651. and load it when your program is run. Most platforms have an
  652. environment variable to which you can add the directory containing
  653. the library. On many platforms (Linux, FreeBSD) that variable is
  654. <tt class="docutils literal"><span class="pre">LD_LIBRARY_PATH</span></tt>, but on MacOS it's <tt class="docutils literal"><span class="pre">DYLD_LIBRARY_PATH</span></tt>, and
  655. on Cygwin it's simply <tt class="docutils literal"><span class="pre">PATH</span></tt>. In most shells other than <tt class="docutils literal"><span class="pre">csh</span></tt>
  656. and <tt class="docutils literal"><span class="pre">tcsh</span></tt>, you can adjust the variable as follows (again, don't
  657. type the <tt class="docutils literal"><span class="pre">$</span></tt>—that represents the shell prompt):</p>
  658. <pre class="literal-block">
  659. <strong>$</strong> <em>VARIABLE_NAME</em>=<em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>}
  660. <strong>$</strong> export <em>VARIABLE_NAME</em>
  661. </pre>
  662. <p>On <tt class="docutils literal"><span class="pre">csh</span></tt> and <tt class="docutils literal"><span class="pre">tcsh</span></tt>, it's</p>
  663. <pre class="literal-block">
  664. <strong>$</strong> setenv <em>VARIABLE_NAME</em> <em>path/to/lib/directory</em>:${<em>VARIABLE_NAME</em>}
  665. </pre>
  666. <p>Once the necessary variable (if any) is set, you can run your
  667. program as follows:</p>
  668. <pre class="literal-block">
  669. <strong>$</strong> <em>path</em>/<em>to</em>/<em>compiled</em>/example &lt; <em>path</em>/<em>to</em>/jayne.txt
  670. </pre>
  671. <p>The program should respond with the email subject, “Will Success
  672. Spoil Rock Hunter?”</p>
  673. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  674. <!-- Software License, Version 1.0. (See accompanying -->
  675. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  676. </div>
  677. </div>
  678. <div class="section">
  679. <h1><a class="toc-backref" href="#id34" id="conclusion-and-further-resources" name="conclusion-and-further-resources">7&nbsp;&nbsp;&nbsp;Conclusion and Further Resources</a></h1>
  680. <p>This concludes your introduction to Boost and to integrating it
  681. with your programs. As you start using Boost in earnest, there are
  682. surely a few additional points you'll wish we had covered. One day
  683. we may have a “Book 2 in the Getting Started series” that addresses
  684. them. Until then, we suggest you pursue the following resources.
  685. If you can't find what you need, or there's anything we can do to
  686. make this document clearer, please post it to the <a class="reference" href="../../more/mailing_lists.htm#users">Boost Users'
  687. mailing list</a>.</p>
  688. <ul class="simple">
  689. <li><a class="reference" href="../../tools/build/v2">Boost.Build reference manual</a></li>
  690. <li><a class="reference" href="../../tools/jam/index.html">Boost.Jam reference manual</a></li>
  691. <li><a class="reference" href="../../more/mailing_lists.htm#users">Boost Users' mailing list</a></li>
  692. <li><a class="reference" href="../../more/mailing_lists.htm#jamboost">Boost.Build mailing list</a></li>
  693. <li><a class="reference" href="http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl?Boost.Build_V2">Boost.Build Wiki</a></li>
  694. <li><a class="reference" href="../../libs/index.html">Index of all Boost library documentation</a></li>
  695. </ul>
  696. <div class="admonition-onward admonition">
  697. <p class="first admonition-title">Onward</p>
  698. <blockquote class="epigraph last">
  699. <p>Good luck, and have fun!</p>
  700. <p class="attribution">&mdash;the Boost Developers</p>
  701. </blockquote>
  702. </div>
  703. <hr class="docutils" />
  704. <table class="docutils footnote" frame="void" id="packagers" rules="none">
  705. <colgroup><col class="label" /><col /></colgroup>
  706. <tbody valign="top">
  707. <tr><td class="label"><a class="fn-backref" href="#id2" name="packagers">[1]</a></td><td><p class="first">If developers of Boost packages would like to work
  708. with us to make sure these instructions can be used with their
  709. packages, we'd be glad to help. Please make your interest known
  710. to the <a class="reference" href="../../more/mailing_lists.htm#main">Boost developers' list</a>.</p>
  711. </td></tr>
  712. </tbody>
  713. </table>
  714. <table class="docutils footnote" frame="void" id="lowercase-l" rules="none">
  715. <colgroup><col class="label" /><col /></colgroup>
  716. <tbody valign="top">
  717. <tr><td class="label"><a class="fn-backref" href="#id11" name="lowercase-l">[2]</a></td><td>That option is a dash followed by a lowercase “L”
  718. character, which looks very much like a numeral 1 in some fonts.</td></tr>
  719. </tbody>
  720. </table>
  721. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  722. <!-- Software License, Version 1.0. (See accompanying -->
  723. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  724. <table class="docutils footnote" frame="void" id="warnings" rules="none">
  725. <colgroup><col class="label" /><col /></colgroup>
  726. <tbody valign="top">
  727. <tr><td class="label"><a class="fn-backref" href="#id4" name="warnings">[3]</a></td><td>Remember that warnings are specific to each compiler
  728. implementation. The developer of a given Boost library might
  729. not have access to your compiler. Also, some warnings are
  730. extremely difficult to eliminate in generic code, to the point
  731. where it's not worth the trouble. Finally, some compilers don't
  732. have any source code mechanism for suppressing warnings.</td></tr>
  733. </tbody>
  734. </table>
  735. <table class="docutils footnote" frame="void" id="distinct" rules="none">
  736. <colgroup><col class="label" /><col /></colgroup>
  737. <tbody valign="top">
  738. <tr><td class="label"><a class="fn-backref" href="#id13" name="distinct">[4]</a></td><td>This convention distinguishes the static version of
  739. a Boost library from the import library for an
  740. identically-configured Boost DLL, which would otherwise have the
  741. same name.</td></tr>
  742. </tbody>
  743. </table>
  744. <table class="docutils footnote" frame="void" id="debug-abi" rules="none">
  745. <colgroup><col class="label" /><col /></colgroup>
  746. <tbody valign="top">
  747. <tr><td class="label"><a class="fn-backref" href="#id14" name="debug-abi">[5]</a></td><td>These libraries were compiled without optimization
  748. or inlining, with full debug symbols enabled, and without
  749. <tt class="docutils literal"><span class="pre">NDEBUG</span></tt> <tt class="docutils literal"><span class="pre">#define</span></tt>d. Although it's true that sometimes
  750. these choices don't affect binary compatibility with other
  751. compiled code, you can't count on that with Boost libraries.</td></tr>
  752. </tbody>
  753. </table>
  754. <table class="docutils footnote" frame="void" id="native" rules="none">
  755. <colgroup><col class="label" /><col /></colgroup>
  756. <tbody valign="top">
  757. <tr><td class="label"><a class="fn-backref" href="#id15" name="native">[6]</a></td><td>This feature of STLPort is deprecated because it's
  758. impossible to make it work transparently to the user; we don't
  759. recommend it.</td></tr>
  760. </tbody>
  761. </table>
  762. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  763. <!-- Software License, Version 1.0. (See accompanying -->
  764. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  765. <!-- This file contains all the definitions that need to be updated -->
  766. <!-- for each new release of Boost. -->
  767. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  768. <!-- Software License, Version 1.0. (See accompanying -->
  769. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  770. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  771. <!-- Software License, Version 1.0. (See accompanying -->
  772. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  773. <!-- Copyright David Abrahams 2006. Distributed under the Boost -->
  774. <!-- Software License, Version 1.0. (See accompanying -->
  775. <!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
  776. </div>
  777. </div>
  778. </body>
  779. </html>
粤ICP备19079148号