我搜索了很多,但没有找到任何有用的分步指南来安装、配置和构建带有 VS 2019 预览版的 Windows 10。你们中的任何人都可以指导我完成这项任务吗?
我下载了 boost 1.70,但是当我执行 bootstrap.bat 时,它给出了以下消息:
C:\libraries\boost\boost_1_70_0>bootstrap.bat
Building Boost.Build engine
Failed to build Boost.Build engine.
Please consult bootstrap.log for further diagnostics.
C:\libraries\boost\boost_1_70_0>
Run Code Online (Sandbox Code Playgroud)
此文件本身具有以下文本:
c:\libraries\boost\boost_1_70_0\tools\build\src\engine>if exist bootstrap rd /S /Q bootstrap
c:\libraries\boost\boost_1_70_0\tools\build\src\engine>md bootstrap
c:\libraries\boost\boost_1_70_0\tools\build\src\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0 command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c
command.c
compile.c
constants.c
debug.c
execcmd.c
execnt.c
filent.c
frames.c
function.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
object.c
Generating Code...
Compiling...
option.c
output.c
parse.c
pathnt.c
pathsys.c
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
md5.c
class.c
cwd.c
w32_getreg.c
Generating Code...
Compiling...
native.c
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
Generating Code...
Run Code Online (Sandbox Code Playgroud)
当我尝试 boost 1.68 时,我可以成功运行 bootstrap.bat,但是当我执行 b2.exe 时,它给了我以下消息:
warning: Did not find command for MSVC toolset. If you have Visual Studio 2017 installed you will need to specify the full path to the command, set VS150COMNTOOLS for your installation, or build from the 'Visual Studio Command Prompt for VS 2017'.
Run Code Online (Sandbox Code Playgroud)
您目前无法使用Preview构建 Boost ,但您可以使用刚刚发布的常规 2019。我有同样的问题。安装具有所需功能的 2019 常规版大约需要十分钟。您可以同时拥有两者。
为了将来参考,这里是我关于如何在支持 MPI 和 python 的 Windows 上构建 boost 的笔记。
需要 Visual Studio 2019 非预览版,任何版本,所有 C++ 和 Windows SDK 的东西。
注意:如果您同时拥有 C++ 和 Windows SDK,请暂时从 VS Preview 中卸载它们。理想情况下,系统上只有一个编译器,因此Boost.build不会感到困惑。
接下来,假设你已经安装了 git-for-windows,执行
git clone https://github.com/boostorg/boost.git --recursive
Run Code Online (Sandbox Code Playgroud)
将 boost 超级项目存储库复制到名为/Boost/(必须不受保护!)
cd boost
Run Code Online (Sandbox Code Playgroud)
现在你在/Boost/boost. 签出开发者分支(获取最近的更新)
git checkout develop -f
Run Code Online (Sandbox Code Playgroud)
其中 -f 强制更新。
使用 Visual Studio 开发人员控制台在 boost 文件夹内运行引导程序。要激活此控制台,请使用 Windows 搜索栏“在此处键入以搜索” “开发人员命令提示符”,或打开 Visual Studio 并使用顶部的搜索栏。
注意:如果您遇到访问错误,则必须激活管理 Visual Studio 开发人员控制台。cmd在管理模式下打开并运行 VsDevCmd.bat,该文件可激活 Visual Studio 开发人员控制台。
bootstrap
Run Code Online (Sandbox Code Playgroud)
如果您还没有这样做,请通过安装适用于最新版本 Microsoft MPI 的两个文件来安装 Microsoft MPI。已知它与Version 10一起使用,需要将 SDK(一个 .msi 文件)和非 SDK(一个 .exe 文件)文件安装到 DEFAULT 位置。不要修改这些位置。
然后将/Boost/boost/目录中的project-config.jam修改为如下:
(顺便说一句,每行后面都有空格 [一个常规空格],甚至是空行)
# Boost.Build Configuration
# Automatically generated by bootstrap.bat
import option ;
using msvc ;
option.set keep-going : false ;
using python ;
using mpi ;
Run Code Online (Sandbox Code Playgroud)
最后两行假设您需要 mpi 和 python 支持。
现在打开 Visual Studio 开发人员控制台并导航 (cd) 到 boost 文件夹/Boost/boost。由于我们使用的是 VS 2019 的 Visual C++ 编译器,显然我们不需要b2 install任何东西(请参阅入门指南中的第 5.1 - 5.2 节)。那么接下来我们唯一需要的就是运行
b2 -j8 --address-model=64
Run Code Online (Sandbox Code Playgroud)
选项包括
--toolset=14.xx[指定 vs 编译器版本 14.15 等](或者toolset没有--,有人告诉我,不确定哪个是正确的,请告诉我,对我来说是--)-a 重建所有-j8 8核编译--address-model=64(或address-model没有--,有人告诉我,不确定哪个是正确的,请告诉我,对我来说是--)64 位> my_log.txt 最后记录构建中大量的文本输出,以备后用(确保一切正常)。我怀疑你不是在boost窗户里建造的Visual Studio tools Command Prompt。
请参阅我在这里给出的答案:How to build 64-bit boost for Visual Studio on windows using the address-model flag? 和这里如何在 64 位中构建 Boost 1.64?