- Extract downloaded boost source, e.g.
C:\Program Files\boost_1_59_0
. - Create a folder for Boost.Build installation, e.g.
C:\Program Files\boost-build
. - Create a folder within for building, i.e.
C:\Program Files\boost_1_59_0\build
. - Create a folder for installation, e.g.
C:\Program Files\boost
.
- Open Command Prompt.
- Run
g++ --version
. - If the output contains g++ version number then GCC should be set up properly to run from command line and you can continue.
- Open Command Prompt and navigate to
C:\Program Files\boost_1_59_0\tools\build
. - Run
bootstrap.bat mingw
. - Run
b2 install --prefix="C:\Program Files\boost-build"
. - Add
C:\Program Files\boost-build\bin
to Windows PATH.
- Open Command Prompt and navigate to
C:\Program Files\boost_1_59_0
. - Run
b2 --build-dir="C:\Program Files\boost_1_59_0\build" --prefix="C:\Program Files\boost" toolset=gcc install
- Add include folder, i.e.
C:\Program Files\boost\include\boost-1_59
. - Add linker folder, i.e.
C:\Program Files\boost\lib
. - Link required libraries, e.g.
libboost_regex-mgw48-mt-1_59.a
.
Solved......................
When first steps done as above the b2.ex was build in the C:\Program Files\boost-build directory.
So the simple solution was to put it into the C:\Program Files\boost_1_73_0 directory
and ran b2 with toolset=gcc (if using gcc). This created all the libs and copied hpp files over to
C:\Program Files\boost-build directory (note this is not inside of the boost root folder)
In CodeBlocks in Compiler settings "Search Directories + Compiler enter
C:\Program Files\boost-build\include\boost-1_73. Its important to point to
boost-1_73 directory otherwise boost hpp files will not work.
There is no need to link the compiler to the C:\Program Files\boost-build\ bin directory
as each project needs to have the appropriate libs attached be aware that there are 2 libs
of each required lib. One for debug and one for release versions for example
Project->Build Options->Linker Settings debug=
..........\Program Files\boost-build\lib\libboost_locale-mgw6-mt-d-x32-1_73.a (notice the "d")
and in the release= ..........\Program Files\boost-build\lib\libboost_locale-mgw6-mt-x32-1_73.a
test it with any of the sample programs at https://www.boost.org/doc/libs/1_73_0/ .
It all works so hope this info helps someone.