如何使用地址模型标记在Windows上为Visual Studio构建64位Boost? [英] How to build 64-bit boost for visual studio on windows using the address-model flag?

查看:129
本文介绍了如何使用地址模型标记在Windows上为Visual Studio构建64位Boost?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用以下说明在Visual Studio的x64终端上构建增强功能:

I am trying to build boost on the x64 terminal for Visual Studio using these instructions: https://www.boost.org/doc/libs/1_62_0/more/getting_started/windows.html#get-boost

我愿意:

boostrap

然后

.\b2 address-model=64

但它总是说:

C:\boost_1_70_0>.\b2 address-model=64
Performing configuration checks

    - default address-model    : 32-bit
    - default architecture     : x86

Building the Boost C++ Libraries.

...

,然后继续构建所有内容的32位版本.我知道这一点,因为当我尝试将boost用于CMake之类时,它抱怨它的32位:

and then goes on to build 32 bit versions of everything. I know this because when I try and use boost for things like CMake it complains that its 32 bit:

C:\src\SimpleAmqpClient\simpleamqpclient-build>cmake -DBOOST_ROOT=C:\boost_1_70_0 -DBOOST_LIBRARYDIR=C:\boost_1_70_0\stage\lib ..
-- Found Boost 1.70.0 at C:/Program Files/boost/lib/cmake/Boost-1.70.0
--   Requested configuration: QUIET REQUIRED COMPONENTS chrono;system
-- Found boost_headers 1.70.0 at C:/Program Files/boost/lib/cmake/boost_headers-1.70.0
-- Found boost_chrono 1.70.0 at C:/Program Files/boost/lib/cmake/boost_chrono-1.70.0
-- No suitable boost_chrono variant has been identified!
--   libboost_chrono-mgw82-mt-d-x32-1_70.a (32 bit, need 64)
--   libboost_chrono-mgw82-mt-x32-1_70.a (32 bit, need 64)
CMake Error at C:/Program Files/boost/lib/cmake/Boost-1.70.0/BoostConfig.cmake:95 (find_package):
  Found package configuration file:

    C:/Program Files/boost/lib/cmake/boost_chrono-1.70.0/boost_chrono-config.cmake

  but it set boost_chrono_FOUND to FALSE so package "boost_chrono" is
  considered to be NOT FOUND.  Reason given by package:

  No suitable build variant has been found.

Call Stack (most recent call first):
  C:/Program Files/boost/lib/cmake/Boost-1.70.0/BoostConfig.cmake:124 (boost_find_dependency)
  C:/Program Files/CMake/share/cmake-3.15/Modules/FindBoost.cmake:273 (find_package)
  CMakeLists.txt:35 (FIND_PACKAGE)


-- Configuring incomplete, errors occurred!
See also "C:/src/SimpleAmqpClient/simpleamqpclient-build/CMakeFiles/CMakeOutput.log".

是的,我该如何构建64位?

So yeah, how can I build 64-bit?

推荐答案

请参阅我在此处给出的答案:

See the answer I gave here: How to build Boost 1.64 in 64 bits?
If you want to specify the toolset explicitly then Visual Studio 2019 is toolset=msvc-14.2

注意:确保从Visual Studio tools Command Prompt
构建它 并忽略控制台上的- default address-model : 32-bit输出,它将构建64位二进制文​​件.

Note: ensure that you build it from a Visual Studio tools Command Prompt
and ignore the - default address-model : 32-bit output on the console, it builds 64 bit binaries.

这篇关于如何使用地址模型标记在Windows上为Visual Studio构建64位Boost?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆