Skip to content

Instantly share code, notes, and snippets.

@simplay
Last active December 2, 2015 16:28
Show Gist options
  • Select an option

  • Save simplay/971ae93a70f1176b5ce9 to your computer and use it in GitHub Desktop.

Select an option

Save simplay/971ae93a70f1176b5ce9 to your computer and use it in GitHub Desktop.

How to install Boost (1.55 or greater)

On windows 7 or greater

Requirements

  • Visual Studio installed on your system
  • Admin Privileges

Sources

Steps

  1. Download the Boost (See 1. Get Boost described in [1]) archieve and then extract it.
  • The location of the extracted file matters and will directly determine the header inclusion and lib linking paths.
  1. Open as a administrator a Windows Developer Command Prompt, cd into extracted boos directory and run bootstrap.bat
  • additionally, a particular compiler can be specified: bootstrap.bat <COMPILER> where compiler is either gcc (when using linux or mingw,cygwin), msvc (when using windows' visual studio), darwin (when using mac os x).
  1. (Optional) Move your boost directory to target location (after compiling the source this is no more possible). From now on, let us call boost's location <boost-path>.
  • Advice: Extract boost's content into C:/boost_my_downloaded_version since cmake makes certain assumptions about boost being located there.
  1. Build Boost via b2 install. This will take a while.
  • There are several build options (see [2]), however, the above command will work on windows when having Visual Studio installed.
  • After having built the source successfully, boosts reports us the path to include boost headers and the path to link additional boost libs. The header path is usually equal to <boost-path> (<HP>) and the linker path (<LP> is usually <boost-path>\stage\lib.
  1. Start a new visual studio project (e.g. a new win32 console application)
  • On the bottom left, click onto Solution Explorer
  • Right click onto the project -> Properties
  • Assign the header path: Configuration, Properties-> C/C++ -> General -> Additional Include Directories.
  • Edit it and add <HP> (see above) to it. Apply the changes.
  • then go to Configuration Properties-> C/C++ -> Precompiled Headers and set the option Precompiled Headers to Not Using Precompiled Headers.
  • Assign the linker path: Go to Properties -> Linker -> General -> Additional Library Directories and assign <HP> (from above). Apply all changes.
  • Compiling boost requiring projects via BUILD -> Build Solution should now work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment