Memo‎ > ‎

Build Boost

posted Dec 28, 2012, 8:51 AM by Teng-Yok Lee   [ updated Jul 18, 2020, 7:57 PM ]

For Windows x64

In my experience, build from source is best if I want to link boost library for static linking. Remember to use the Visual Studio Command Prompt or b2 cannot find the command cl.exe. When running bootstrap/b2, the options are below:

$ bootstrap
# To build Boost for 1) x64 configuration, 2) static linking, and 3) Visual Studio 2010
$ b2 --toolset=msvc-10.0 architecture=x86 address-model=64 link=static
$ b2 install --prefix=C:\boost

Related discussions on StackOverflow:

64-bit version of Boost for 64-bit windows
How do you build the x64 Boost libraries on Windows?
VC++ cl.exe — DLL not found

For Linux

If bzip does not exist, use b2 as follows:

./b2 -sNO_BZIP2=1

Note that on Linux, the libraries must be manually linked.

Reference:

Installation from http://www.boost.org/.

Comments