我已经构建过很多次x86 Boost库,但是我似乎不能构建x64库。我启动"Visual Studio2005 x64交叉工具命令提示符“并运行我通常的构建:
bjam --toolset=msvc --build-type=complete --build-dir=c:\build install
但它仍然会生成x86 .lib文件(我用dumpbin /headers验证了这一点)。我做错了什么?
发布于 2008-11-19 15:28:41
您需要添加address-model=64
参数。
例如,看看here。
发布于 2017-06-14 17:56:57
公认的答案是正确的。添加这个,以防其他人在谷歌上搜索这个答案,但仍然无法生成x64版本。
以下是我在Visual Studio 15 2017社区版上构建Boost 1.63所必须做的事情。
从VS环境cmd shell执行的命令。工具-> Visual Studio命令提示符
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
您可以使用x64验证生成的.lib是否为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)
...
发布于 2019-10-30 10:24:28
对于b2,命令是:
b2 --build-dir=build/x64 address-model=64 threading=multi --build-type=complete --stagedir=./stage/x64
它将在开始时显示default address-model: 32-bit
,但仍将内置64位(多么令人困惑).You应该使用诸如library-vc140-mt-x64-1_71.dll
之类的名称创建dlls,以确认它是64位的。
https://stackoverflow.com/questions/302208
复制相似问题