tags:

views:

1999

answers:

5
+5  Q: 

Boost 1.37

I can't find a pre-built set of MSVC++ libs for Boost 1.37.0 (latest stable version), only the source. I don't understand how their weird build system works... are there any places I can find a download of a visual studio project or something?

+2  A: 

This post may help: http://stackoverflow.com/questions/256109/how-to-install-boost-to-the-vs-2008

kenny
+1  A: 

Building it isn't difficult. They have a fairly good expanaltion of the default process here: http://www.boost.org/doc/libs/1_37_0/more/getting_started/windows.html#or-build-binaries-from-source

Download bjam (from sourceforge, there are links from the boost website), as well as the boost sources, make sure bjam is accessible from the boost dir, cd to the boost dir, and run something like the following:

bjam --build-dir= --prefix-dir= --toolset=msvc --build-type=complete install

where is an temp dir where it can store intermediate files, and is the final install location. There are all sorts of other options you can play around with, and not all of them are documented very well, but the basics are fairly simple.

For more help, you can run bjam --help from the boost source dir.

jalf
+2  A: 

It seems complicated, but building Boost is really not that bad. First you need to download the bjam tool (SourceForge is a good source). Make sure bjam.exe is in a directory in your PATH.

Go the the root of your unzipped Boost download (e.g. C:\Boost_1_37_0)

Type bjam --help to get a list of all your build options.

I use the following command to build everything, you can customize it to suit your needs:

bjam --prefix=C:\boost --build-dir=C:\build --build-type=complete install

The results will be placed in C:\boost and you can delete C:\build.

Ferruccio
+9  A: 

The BoostPro Computing folks maintain the Boost installer for Windows but it usually take a few weeks for them to put new versions online. It's not yet up for 1.37.

There's no Visual Studio solution (remember, Boost targets many platforms) though there is an effort to also support building Boost with CMake. I'm not sure how far along they got for 1.37 but I believe it's still early days for this process.

However the standard build system isn't that weird! Start by downloading bjam for your platform (look for a suffix of 'ntx86' for Windows) and installing it somewhere in your path (C:/Windows/System32). Then download the source, uncompress it and run the build system from the command line. It'll look something like this for Visual Studio users:

bjam --build-dir="C:\boostsource" --toolset=msvc --build-type=complete stage

This is lifted pretty much from the Getting Started Guide which goes into much more detail. The build-dir is not needed if you're current directory is the root of the source.

After waiting a couple of hours for everything to build ('complete' means that it'll build debug, release, single/multi threaded, static/dynamic, static/dynamic linking to the runtimes - and combinations) you'll end up with all of the libs in a 'stage/lib' directory.

Finally you need to tell Visual Studio where to find the headers and libs. Go to Tools->Options->Projects and Solutions->VC++ Directories. Add an entry for "Include files" (like "C:\boostsource"). Add an entry for "Library files" ("C:\boostsource\stage\lib").

MattyT
Considering by default the library files are placed inside a lib directory inside stage, you'd want to add "C:\boostsource\stage\lib" and not "C:\boostsource\stage".
KTC
Why does it take hours? It's not exactly the biggest code-base.
MidnightGun
@KTC: Thanks, I've edited the post to reflect the correct dir location.
MattyT
@MidnightGun: Mostly because it builds all combinations of the differnt ways the libraries can be packaged. I've tried to explain this better in the post.
MattyT
BTW you can choose to configure which versions of the libs to build but I've always found it easier to build them all as it's not uncommon to change our minds as to how we're going to package our software (shared or static libs for example).
MattyT
+3  A: 

I've got a build of 1.37 (VC 7.1, 8, 9) on my website, help yourself.

http://boost.teeks99.com/

(Update... 1.38 is up there as well)
(Another Update, 1.39 is now there)
(1.40 is up) (1.41 is up, a bit late)

teeks99