Building Boost BCP

I tried to create Boost C ++ Libraries in the last two hours and stopped without any results. Since I am new to C ++, I cannot get the correct assembly. How can I build it correctly using Visual Studio 2008?

I need to use the BCP tool to extract a subset of the library. So I need to create a BCP first, right? How to do it? When I tried to build it, I got the following error:

Fatal error LNK1104: Cannot open the file libboost_filesystem-vc90-mt-gd-1_37.lib.

Where can I get the above library file?

+44
c ++ boost
Jan 13 '09 at 20:09
source share
4 answers

First, you must have the correct PATH, INCLUDE, and LIB environment variables in the shell. To do this, call the file " vcvarsall.bat " (or similar) with the parameter:

 vcvarsall.bat x86 

Then you need to build bjam (you can also download it from the Boost page, but it's almost as fast). Go to the tools\jam\src folder in Boost and type:

 build.bat 

It should create a bin.ntx86 subfolder containing the bjam.exe file. For convenience, copy it to the main Boost folder. Then you can build bcp. Go to the tools\bcp and type:

 ..\..\bjam.exe --toolset=msvc 

In the main Boost folder, you can create any library you want:

 bjam toolset=msvc –-with-{library} 

where {library} is one of the libraries to build. All built-in libraries can be shown with:

 bjam –-show-libraries 

There are a few more options for building bjam. Some options with keywords that you can specify:

 variant=debug|release link=shared|static threading=multi|single 

Example:

 bjam toolset=msvc –-with-filesystem threading=multi variant=debug stage 

For more information, visit the Boost documentation page .

Edit: Updated link to point to latest Boost documentation

Edit: Fixed parameters --with- {library} and --show-libraries

+34
Jan 13 '09 at 20:24
source share

The current version of Boost (1.50.0) uses Boost.Build. The new workflow for building bcp is as follows:

from the root directory of Boost enter:

 bootstrap.bat 

Then, once Boost.Build is built, enter:

 b2 tools/bcp 
+104
Jul 18 '12 at 14:50
source share

I extracted the source: https://github.com/district10/cmake-bcp (you do not need to configure BOOST because all the source code is already included).

On Linux, cmake + make to build:

 # cd source_dir mkdir build && cd build cmake .. make 

On Windows: CMake-GUI + Visual Studio for assembly. Help is needed? See HOWTO: Win + CMake + Visual Studio 2010 .

My executables:




Tip. If you encounter problems with binding to Windows when using Boost, go to boost/config/auto_link.hpp and you will understand. To solve this problem, you can simply comment on the whole file.

+1
Nov 21 '16 at 4:48
source share

Please note that you do not need to create bcp versions for Windows from the source code - you can also download the binary version from http://www.boostpro.com/download and skip all these steps.

(Or, at least theoretically - I have not tried, I just found this page and this one when you are looking for a pre-built version of Linux.)

0
Dec 12 '09 at 20:14
source share



All Articles