How do you build the x64 Boost libraries on Windows?

匿名 (未验证) 提交于 2019-12-03 01:23:02

问题:

I've built the x86 Boost libraries many times, but I can't seem to build x64 libraries. I start the "Visual Studio 2005 x64 Cross Tools Command Prompt" and run my usual build:

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

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

回答1:

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

Look e.g. here.



回答2:

The accepted answer is correct. Adding this in case somebody else googles this answer and still fails to produce x64 version.

Following is what I had to do to build Boost 1.63 on VS 15 2017 Community Edition.

Commands executed from VS environment cmd shell. 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 is 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) ... 


回答3:

You may find following Boost.Build property:

address-model=64 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!