14

Here's a question you may have seen around the 'nets in various forms...summed up here for you googling pleasure :-)

I have a project that is built with Microsoft's Visual Studio and uses functionality from boost (http://www.boost.org/). I already have my project working with some of the libraries that are header only (no binary library needed to link with). How or where can I get the windows binaries for the other libraries?

denfromufa
  • 5,610
  • 13
  • 81
  • 138
teeks99
  • 3,585
  • 2
  • 30
  • 38

6 Answers6

21

There are three different options for accessing the binary libraries:

1) Build them from source.
Go into the boost directory and run:

    bootstrap
    .\bjam

Or get more complicate and do something like:

    bjam --stagedir="c:\Program Files\Boost" --build-type=complete --toolset=msvc-9.0 --with-regex --with-date_time --with-thread --with-signals --with-system --with-filesystem --with-program_options stage

2) Use the BoostPro installer (http://www.boostpro.com/download) to get the specific libraries that you need.
This is very nice because it only downloads and installs the files that you say you want. However, it never has the most current version available, and there are no 64 bit binaries.

3) Download the entire set of libraries (http://boost.teeks99.com)
Easy to use, simple to do, but the libraries are huge (7GB unzipped!).
Edit 2013-05-13: My builds are now available (starting from 1.53) directly from the sourceforge page.

teeks99
  • 3,585
  • 2
  • 30
  • 38
  • 4
    Why do you ask a question, then provide a 3-point answer to your own question 5 minutes later? Are you just farming rep by asking simple questions then answering them yourself? – Roel Jan 12 '10 at 15:22
  • 7
    I'd seen a bunch of people ask this question in different forms, sometimes not knowing how to ask. I just wanted to get it out there in a clear manner so anyone could find it. – teeks99 Jan 12 '10 at 15:25
  • 2
    I don't see anything wrong with what you are doing. Though maybe you should explicitly say that this is an amalgamation of other questions so people can decide on their own if they want to vote you up for your editing effort. – A. Levy Jan 12 '10 at 22:02
  • 2
    Yeah, I added a comment towards that end in the original question. Also, on the meta site, I found the question about this etiquette: http://meta.stackexchange.com/questions/12513/stackoverflow-should-i-answer-my-own-question-or-not/12519#12519 – teeks99 Jan 13 '10 at 00:57
  • I remember doing like (1) (building myself) and I ended up using a very large amount of disk space. I guess the disk space of (3) is similar to the one of (1) if you build everything. – Wernight Aug 04 '10 at 20:43
4

conda-forge (automated cross-platform cloud build tool and package manager) provides binaries for all major platforms:

https://anaconda.org/conda-forge/boost

You can now get Boost binaries from:

http://sourceforge.net/projects/boost/files/boost-binaries/

However they do not specify whether it is release or debug version.

denfromufa
  • 5,610
  • 13
  • 81
  • 138
  • 3
    Those are the same as the ones at http://boost.teeks99.com (I've become the official binary builder). They contain both debug an release versions. – teeks99 Aug 29 '14 at 20:07
3

I used to prefer using BoostPro to install the Boost libraries that needed separate compilation, such as Boost.Regex, but alas this no longer seems to be supported.

Go to the Boost Getting Started for Windows page, it tells you pretty much everything you need to know in section 5.2.1. Here is a simple guide (with screenshots) that shows you how to get started.

To summarize, from the command prompt you need to run the following commands:

> boostrap.bat
> .\b2

Running the .\b2 command can take quite some time.

And then in your Visual Studio project properties, you'll need to:

  1. Select the C/C++ > General tab and set the Additional Include Directories field
  2. Select the Linker > General tab and set the Additional Library Directories field.

For step 2, this is typically the stage\lib directory of your Boost root directory.

AndyUK
  • 3,933
  • 7
  • 42
  • 44
1

Build them yourself. Download a bjam executable from the boost website, then execute the following command from the boost src root directory:

bjam --toolset=msvc --build-type=complete define=_BIND_TO_CURRENT_MFC_VERSION=1 define=_BIND_TO_CURRENT_CRT_VERSION=1 stage

Then go get some coffee or leave it running over night. After that you get results in the 'stage' folder. Add this directory to your 'library files' in options->projects and solutions->VC++ directories.

Roel
  • 19,338
  • 6
  • 61
  • 90
  • To clarify, the _BIND_TO_CURRENT_MFC_VERSION is to prevent issues when deploying later; see my answers to another question at http://stackoverflow.com/questions/59635/app-does-not-run-with-vs-2008-sp1-dlls-previous-version-works-with-rtm-versions/70808#70808 . – Roel Jan 12 '10 at 15:20
1

Consider some of the recently sprung-up package managers for C++

Originally, I wanted to use Bazel, but it does not have boost yet in its bzlmod registry.

vcpkg instructions

  1. Follow the Get started with vcpkg document to install and setup vcpkg
  2. Install boost for x64-windows by running
vcpkg install --triplet=x64-windows boost-program-options boost-system boost-test

See also the docs in the vcpkg project repo (link goes to rendered readthedocs version).

user7610
  • 25,267
  • 15
  • 124
  • 150
0

1) navigate to boost directory

2) run bootstrap - note: bjam doesn't appear to work at this point, but maybe i did something wrong

3) run .\b2 this should set up boost defaulting to what it detects as your primary, or maybe most recent windows toolset, so for me this is msvc11.0

then you wait a while, and voila!

as the above says, just include the directories of the boost libs (D:\boost_1_5x_x\stage\lib) and includes that you use in the respective Additional Directories fields. You do not need to necessarily do this from "C/C++" or "Linker". there is a heading VC++ that has all of the relevant fields there. you can also, if you are regularly using boost, include them in the inherited directories listing

**edit: only just realized that the post above outlines this. very sorry.

physincubus
  • 986
  • 2
  • 11
  • 26