How do you create x64 boost libraries on windows?

I have built up x86 Boost libraries many times, but I cannot create x64 libraries. I run "Visual Studio 2005 x64 Cross Tools Command Prompt" and run my normal build:

bjam --toolset=msvc --build-type=complete --build-dir=c:\build install 

But it still creates x86.lib files (I checked this with dumpbin / headers). What am I doing wrong?

+48
c ++ boost 64bit visual-studio-2005 boost-build 64-bit
Nov 19 '08 at 15:18
source share
3 answers

You need to add the parameter address-model=64 .

Take a look, for example. here .

+58
Nov 19 '08 at 15:28
source share

The accepted answer is correct. Adding this in case someone else googles this answer and still cannot create the x64 version.

Here is what I needed to do to build Boost 1.63 in Visual Studio 15 2017 Community Edition.

Commands executed from the VS cmd shell environment. Tools -> Visual Studio Command Prompt

 C:\Work\Boost_1_63> C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat amd64 C:\Work\Boost_1_63> bootstrap.bat C:\Work\Boost_1_63> bjam -j4 architecture=x86 address-model=64 link=static stage C:\Work\Boost_1_63> bjam --prefix=C:\opt\boost architecture=x86 address-model=64 link=static install 

You can verify that the resulting .lib x64 with dumpbin:

 C:\Work> dumpbin /headers C:\work\boost_1_63\stage\lib\libboost_locale-vc140-mt-1_63.lib | findstr machine 8664 machine (x64) 8664 machine (x64) 8664 machine (x64) 8664 machine (x64) ... 
+4
Jun 14 '17 at 9:56 on
source share

You can find the following Boost.Build property :

 address-model=64 
0
Jun 13 '15 at 1:01
source share



All Articles