gpt4 book ai didi

c++ - 如何在 64 位中构建 Boost 1.64?

转载 作者:可可西里 更新时间:2023-11-01 16:32:11 26 4
gpt4 key购买 nike

我运行的是 Windows 10 并在笔记本电脑中安装了 Visual Studio 2017 社区版。我有一些较旧的程序在 VS 2015 中使用 64 位 Boost 1.62.0 编译得很好。出于一些非常奇怪的原因,我无法找到一种方法来使用 VS 2017 和此命令行从 Boost 1.64.0(这里是文件系统和计时器)编译任何库:

b2 --build-dir=..\build_here --with-filesystem --with-timer --address-model=64

命令将执行并构建库,但是是 32 位!!

可能出了什么问题?

问候,胡安登特

最佳答案

更新我给的答案here . Visual Studio 2017 是一个新的工具集,因此只需将 toolset=msvc-14.0(对于 Visual Studio 2015)替换为 toolset=msvc -14.1 即:

在 Visual Studio 工具命令提示符中:

cd boost_1_64_0
call bootstrap.bat

对于静态库(推荐用于 Windows):

b2 -j8 toolset=msvc-14.1 address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=complete stage

注意:必须使用动态链接构建线程,请参阅:https://studiofreya.com/2015/05/20/the-simplest-way-of-building-boost-1-58-for-32-bit-and-64-bit-architectures-with-visual-studio/

在动态库中构建线程:

b2 -j8 toolset=msvc-14.1 address-model=64 architecture=x86 link=shared threading=multi runtime-link=shared --with-thread --build-type=minimal stage

Note: the correct b2 toolset for Visual Studio 2017 is msvc-14.1 not msvc-15.0 and
the b2 toolset for Visual Studio 2019 is msvc-14.2.
If in doubt (and you've only one version of Visual Studio installed) just use toolset=msvc.

关于c++ - 如何在 64 位中构建 Boost 1.64?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43946538/

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