Boost 1.37 pre-built for MSVC

2019-03-28 02:04发布

I can't find a pre-built set of MSVC++ libs for Boost 1.37.0, 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?

标签: c++ boost bjam
5条回答
Fickle 薄情
2楼-- · 2019-03-28 02:37

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").

查看更多
甜甜的少女心
3楼-- · 2019-03-28 02:44

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.

查看更多
Juvenile、少年°
5楼-- · 2019-03-28 02:54

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)

查看更多
迷人小祖宗
6楼-- · 2019-03-28 02:59

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.

查看更多
登录 后发表回答