gpt4 book ai didi

c++ - 从 https ://github. com/boostorg/boost.git 在 Windows 上构建 Boost

转载 作者:行者123 更新时间:2023-12-01 14:08:04 26 4
gpt4 key购买 nike

我一直在尝试从其 git repo https://github.com/boostorg/boost.git 构建 boost 1.73 版在 Windows 上。并且能够构建它,但是当我尝试在代码中使用它时,它正在寻找 boost 1.74 而不是 1.73。
以下是我构建它的步骤:

git clone --recursive https://github.com/boostorg/boost.git
cd boost
rm -rvf more
git checkout tags/boost-1.73.0
git submodule update --init --recursive
克隆完成后。我执行以下操作:
bootstrap.bat
.\b2 --toolset=msvc-14.2 variant=release,debug threading=multi link=shared,static runtime-link=shared,static address-model=64,32 architecture=x86 --layout=versioned --stagedir=out\\release -j %NUMBER_OF_PROCESSORS% -q --hash
Boost 是按预期构建的,但是当我在我的代码中使用它进行静态链接时。链接器查找 boost 版本 1.74,这是目前 master 上的最新版本。但是,如果我从 here 下载源代码然后构建它,一切都按预期工作。
谁能帮我指出我可能做错了什么?
TIA

最佳答案

你写了:

Boost gets built as expected, however when I use it in my code to belinked statically. The linker looks for boost version 1.74,


您可以验证字符串 1.74 Boost 源代码中根本没有出现,使用 git grep 1\\.74 (POSIX shell 需要两个反斜杠,Windows 命令行可能只需要一个反斜杠?)。我这样做了,除了一个文件 doc/test/test.svg 之外,源代码中确实没有 1.74作为与版本控制无关的数字的一部分。*
除了您正在构建的 Boost 之外,您的系统上似乎有或曾经有另一个版本的 Boost,并且 MSVC 正在尝试使用它。在您尝试使用 Boost 的项目中,您需要仔细查看项目属性。看看 MSVC 搜索库和头文件的路径,那里肯定有没有使用你构建的 Boost 的东西。
不清楚为什么当您从 dl.bintray.com 下载源代码时也没有看到此问题 - 该源代码与您从 github 获得的源代码不同,但差异似乎微不足道。

*可悲的是,似乎 git grep并不像我想象的那么可靠。使用 grep --recursive 1\\.74 *找到 1.74 的许多其他实例。但是,我相信它们都是与版本控制无关的数字常量。

关于c++ - 从 https ://github. com/boostorg/boost.git 在 Windows 上构建 Boost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63008435/

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