c++ - 如何使用地址模型标志在 Windows 上为 Visual Studio 构建 64 位提升?
问题描述
我正在尝试使用以下说明在 Visual Studio 的 x64 终端上构建提升: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 位:
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 位?
解决方案
请参阅我在这里给出的答案:如何以 64 位构建 Boost 1.64?
如果您想明确指定工具集,那么Visual Studio 2019
是toolset=msvc-14.2
注意:确保从 a 构建它Visual Studio tools Command Prompt
并忽略- default address-model : 32-bit
控制台上的输出,它构建 64 位二进制文件。
推荐阅读
- regex - 用于匹配来自防火墙系统日志的项目的正则表达式
- javascript - 有没有办法为特定客户存储未传递的消息?
- matplotlib - 'numpy.ndarray' 对象没有属性 'plot' matplotlib 错误
- python - 如何在pyspark中遍历未知数据框的列的行
- jenkins - Jenkins“未知命令”错误的问题
- unity3d - 如何在统一 3D 中放置兴趣点
- swift - 'NSPersistentCloudKitContainer' 仅在 iOS 13.0 或更高版本中可用
- octave - 在多维矩阵上使用逻辑索引替换八度值
- typescript - TypeScript 整数枚举对象可以分配任何值
- ruby-on-rails - 为什么在 Rails 中有时我需要一个包,而有时我不需要?