Skip to content

Instantly share code, notes, and snippets.

@varvaruc
Forked from sim642/boost-windows.md
Created December 17, 2018 15:00
Show Gist options
  • Save varvaruc/a2aacae09973d3ab42dd8fc316ba34ee to your computer and use it in GitHub Desktop.
Save varvaruc/a2aacae09973d3ab42dd8fc316ba34ee to your computer and use it in GitHub Desktop.
Installing boost libraries for GCC (MinGW) on Windows

Installing boost libraries for GCC (MinGW) on Windows

Folder setup

  1. Extract downloaded boost source, e.g. C:\Program Files\boost_1_59_0.
  2. Create a folder for Boost.Build installation, e.g. C:\Program Files\boost-build.
  3. Create a folder within for building, i.e. C:\Program Files\boost_1_59_0\build.
  4. Create a folder for installation, e.g. C:\Program Files\boost.

GCC setup

  1. Open Command Prompt.
  2. Run g++ --version.
  3. If the output contains g++ version number then GCC should be set up properly to run from command line and you can continue.

Boost.Build setup

  1. Open Command Prompt and navigate to C:\Program Files\boost_1_59_0\tools\build.
  2. Run bootstrap.bat mingw.
  3. Run b2 install --prefix="C:\Program Files\boost-build".
  4. Add C:\Program Files\boost-build\bin to Windows PATH.

boost building

  1. Open Command Prompt and navigate to C:\Program Files\boost_1_59_0.
  2. Run
b2 --build-dir="C:\Program Files\boost_1_59_0\build" --prefix="C:\Program Files\boost" toolset=gcc install

Project setup

  1. Add include folder, i.e. C:\Program Files\boost\include\boost-1_59.
  2. Add linker folder, i.e. C:\Program Files\boost\lib.
  3. Link required libraries, e.g. libboost_regex-mgw48-mt-1_59.a.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment