¿Cómo construyes las bibliotecas de x64 Boost en Windows?


He construido las bibliotecas de x86 Boost muchas veces, pero parece que no puedo construir bibliotecas de x64. Inicio el "Visual Studio 2005 x64 Cross Tools Command Prompt" y corro mi compilación habitual:

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

Pero todavía produce x86 .archivos lib (he verificado esto con dumpbin / headers). ¿Qué estoy haciendo mal?

Author: Mihai Limbășan, 2008-11-19

3 answers

Necesita agregar el parámetro address-model=64.

Mira, por ejemplo, aquí.

 56
Author: macbirdie,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2008-11-19 15:28:40

La respuesta aceptada es correcta. Agregar esto en caso de que alguien más busque en Google esta respuesta y aún no produzca la versión x64.

Lo siguiente es lo que tuve que hacer para construir Boost 1.63 en VS 15 2017 Community Edition.

Comandos ejecutados desde el shell CMD de VS environment. Herramientas - > Símbolo del sistema de 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

Puede verificar que el resultado.lib es x64 con 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
Author: Teemu Ikonen,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2018-05-01 09:15:03

Puede encontrar el siguiente Boost.Build property :

address-model=64
 -1
Author: sergtk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2015-06-13 01:01:34