gpt4 book ai didi

c++ - 如何使用地址模型标志在 Windows 上为 Visual Studio 构建 64 位 boost?

转载 作者:行者123 更新时间:2023-12-02 03:20:06 26 4
gpt4 key购买 nike

我正在尝试使用以下说明在 Visual Studio 的 x64 终端上构建 boost:https://www.boost.org/doc/libs/1_62_0/more/getting_started/windows.html#get-boost

我愿意:

boost

然后

.\b2 地址模型=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 位版本。我知道这一点是因为当我尝试对 CMake 之类的东西使用 boost 时,它会提示它是 32 位的:

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 位?

最佳答案

请参阅我在这里给出的答案:How to build Boost 1.64 in 64 bits?
如果您想显式指定工具集,则 Visual Studio 2019toolset=msvc-14.2

注意:确保从 Visual Studio 工具命令提示符
构建它并忽略控制台上的 - default address-model : 32-bit 输出,它会构建 64 位二进制文​​件。

关于c++ - 如何使用地址模型标志在 Windows 上为 Visual Studio 构建 64 位 boost?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56603575/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com