I downloaded the Boost libraries and now I want to build only a few of the libraries. What would be the right command for this? Apparently the built-type=complete option gives me too much. I am using Windows XP and want to use Bjam to compile Boost and MinGW to finally use it. At the moment I think I need the libraries Boost.filesystem, Boost.ProgramOptions and Boost.System. Another question: Where do I put the header-only libraries?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
- What is the correct way to declare and use a FILE
My last build attempt for the Boost 1.55 libraries was a dissappointment. All attempts to build several libraries and only them has ended up with total mess in output.
BJam either tries to build everything or build only the requested, but in the "bin.v2/[long-random-path]" folders (library per directory) with crap in them which is a headache to copy only the link libraries to somethere else.
I have accidentally found the right way to build-and-collect only the libraries I want in one place without any other crap:
The BCP utility is a tool for extracting subsets of Boost. It's useful for Boost authors who want to distribute their library separately from Boost, and for Boost users who want to distribute a subset of Boost with their application.
The current version of Boost (1.50.0) uses Boost.Build. The new workflow for building BCP is as follows:
From the root Boost directory, type:
Then, once Boost.Build has been built, type:
To extract, for example
interprocess
only, you could use:This copies interprocess and its dependencies to
/tmp/interprocess
.An additional note for anyone who sees the error message:
"error: wrong library name '<name of library>' in the --with-<library> option."
.If you try to be clever, as I did, and only extract the
boost
sub-directory of the download onto your system to minimise space,b2
will not be able to find the source code and build options for those libraries that are not header-only. I.e. you need thelib
sub-directory too (andtools
).These answers didn't work for me. On Windows, this worked for me:
For example,
In step 5.2.4 of Getting Started you can instruct
b2
which libraries to build:Alternatively, use
./b2 --show-libraries
to see a list of all libraries that are not header-only.Following is an excerpt from the page:
Note:
b2
command depends upon boost version so use following commands as per your boost version(Also, in this case use--with-libraries=<comma-seperated-library-names>
version instead of--with-<library-name>
):./configure
for1.38.0
and earlier./bootstrap.sh
for1.39.0
onwards till1.46.0
I had the same problem. But I found a way to create the necessary files.
Steps to follow:
First enter the code:
Then enter the following code to generate lib files:
Library files will be created in stage folder.