119
votes

Is there a version of 64-bit Boost library for VS2008 ? Or do I have to compile one myself? if, so, does anyone have experience with it?

5

5 Answers

226
votes

As a short answer:

bjam --toolset=msvc-9.0 address-model=64 --build-type=complete

As a longer answer, here are my build notes for having VS .NET 2008 32-bit and 64-bit boost libraries in the same hierarchy (which is I suspect a common use case):

  1. Build the win32 binaries

    bjam --toolset=msvc-9.0 --build-type=complete stage
    
  2. Create the directory lib\win32

  3. Move the contents of stage\lib to lib\win32
  4. Remove the directories bin.v2 and stage
  5. Build the x64 binaries

    bjam --toolset=msvc-9.0 address-model=64 --build-type=complete stage
    
  6. Create the directory lib\x64

  7. Move the contents of stage\lib to lib\x64
  8. Remove the directories bin.v2 and stage
63
votes

I've got the built binaries on my site: http://boost.teeks99.com

Edit 2013-05-13: My builds are now available (starting from 1.53) directly from the sourceforge page.

22
votes

UPDATE(19.09.2017): added script lines for VS2017. Please be aware that Boost supports VS2017 compiler from a certain version above. I used the latest version (1.65.1).

I used this scripts for building boost for x64 and x86 platforms, lib and dll, debug and release for VS2017, VS2015 and VS2013:

md stage\VS2017\x64
md stage\VS2015\x64
md stage\VS2013\x64    

b2 --stagedir=./stage/VS2017/x64 address-model=64 --build-type=complete --toolset=msvc-14.1 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2017/x64 address-model=64 --build-type=complete --toolset=msvc-14.1 --threading=multi --runtime-link=shared --variant=release  

b2 --stagedir=./stage/VS2015/x64 address-model=64 --build-type=complete --toolset=msvc-14.0 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2015/x64 address-model=64 --build-type=complete --toolset=msvc-14.0 --threading=multi --runtime-link=shared --variant=release

b2 --stagedir=./stage/VS2013/x64 address-model=64 --build-type=complete --toolset=msvc-12.0 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2013/x64 address-model=64 --build-type=complete --toolset=msvc-12.0 --threading=multi --runtime-link=shared --variant=release


md stage\VS2017\win32
md stage\VS2015\win32
md stage\VS2013\win32

b2 --stagedir=./stage/VS2017/win32 --build-type=complete --toolset=msvc-14.1 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2017/win32 --build-type=complete --toolset=msvc-14.1 --threading=multi --runtime-link=shared --variant=release

b2 --stagedir=./stage/VS2015/win32 --build-type=complete --toolset=msvc-14.0 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2015/win32 --build-type=complete --toolset=msvc-14.0 --threading=multi --runtime-link=shared --variant=release

b2 --stagedir=./stage/VS2013/win32 --build-type=complete --toolset=msvc-12.0 --threading=multi --runtime-link=shared --variant=debug
b2 --stagedir=./stage/VS2013/win32 --build-type=complete --toolset=msvc-12.0 --threading=multi --runtime-link=shared --variant=release

pause

You can make a .bat file and run it for building your boost binaries.

12
votes

At this moment, the 64-bits binaries provided by teeks99 (see other answer) appear to be the only free 64-bits binaries around. For a while, BoostPro also provided 64-bits binaries, but as of 1.51 they appear to be out or business.

So, there we're back to two options again: the teeks99 binaries, or building your own.

Most of the information I needed to build my own was here: https://stackoverflow.com/a/2655683/613288

The only thing missing was how to get this to work with the free version of Visual Studio 2010 Express. I found that missing part somewhere else, and after some customization the final recipe I used for my build of the boost 1.49.0 binaries was:

Start Visual C++, and from the Tools menu start Visual Studio Command Prompt.

In the console window, do the following:

"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\setenv.cmd"  /Release  /x64

and then in the boost directory:

bootstrap.bat
b2  -a  -sBZIP2_SOURCE="C:\bzip2-1.0.6"   -sZLIB_SOURCE="C:\zlib-1.2.5"   --toolset=msvc-10.0  architecture=x86  address-model=64  link=static  --with-date_time  --with-filesystem  --with-serialization  --with-test  --with-thread  --with-system  --with-regex  --with-iostreams  stage

The last command is customized for what I happened to need (just some statically linked libraries).

4
votes

I made me a small script which compiles them all for VS2005 and VS2008:

md stage\lib\win32
md stage\lib\x64

REM Visual Studio 2005
bjam --toolset=msvc-8.0 --build-type=complete stage
move /Y stage\lib\* stage\lib\win32\

bjam --toolset=msvc-8.0 address-model=64 --build-type=complete stage
move /Y stage\lib\* stage\lib\x64\

REM Visual Studio 2008
bjam --toolset=msvc-9.0 --build-type=complete stage
move /Y stage\lib\* stage\lib\win32\

bjam --toolset=msvc-9.0 address-model=64 --build-type=complete stage
move /Y stage\lib\* stage\lib\x64\