I was trying to build Boost C++ Libraries for last two hours and stopped without any result. Since I am new to C++, I am unable to get the build right. How can I build it correctly using Visual Studio 2008?
I need to use the BCP tool to extract a subset of library. So I need to build BCP first, right? How to do this? When I tried to build it, I got the following error
fatal error LNK1104: cannot open file ‘libboost_filesystem-vc90-mt-gd-1_37.lib’.
Where can I get the above given library file?
First, you need to have the proper PATH, INCLUDE and LIB environment variables in your command shell. For this, call the file ‘
vcvarsall.bat‘ (or similar) with parameter:Next you have to build bjam (you can also download it from the Boost page, but it’s almost as quick). Go to the
tools\jam\srcfolder in Boost and type:It should produce a subfolder
bin.ntx86that contains bjam.exe. For convenience, copy it to the Boost main folder. Next, you can build bcp. Go into thetools\bcpfolder and type:Back in the Boost main folder you can then build any library you wish:
where
{library}is one of the libraries to build. All buildable libraries can be shown with:There are many more bjam build parameters. Some parameters with keywords you can specify are:
An example would be:
For more infos, visit the Boost documentation pages.
Edit: Updated link to point to most recent Boost documentation
Edit: Corrected options –with-{library} and –-show-libraries