Windows10+VS2022环境下无法编译Boost库的问题求助
解决VS2022编译Boost库时的"Unknown toolset: vcunk"错误
报错信息
Found with vswhere C:\Program Files\Microsoft Visual Studio\2022\Community
"Unknown toolset: vcunk"
You can specify the toolset as the argument, i.e.:
.\build.bat msvc
Toolsets supported by this script are: borland, como, gcc,
gcc-nocygwin, intel-win32, metrowerks, mingw,
vc12, vc14, vc141, vc142
If you have Visual Studio 2017 installed you will need to either update
the Visual Studio 2017 installer or run from VS 2017 Command Prompt
as we where unable to detect your toolset installation.
Failed to build Boost.Build engine.
问题原因
你使用的Boost版本未内置VS2022对应的vc143工具集配置,导致bootstrap脚本无法识别当前VS版本,抛出"Unknown toolset: vcunk"错误。
解决方法
方法一:使用通用
msvc参数执行bootstrap
打开VS2022开发者命令提示符,切换到Boost根目录,执行以下命令:bootstrap.bat msvc该参数会自动适配当前命令提示符关联的VS工具集,无需指定具体版本号。
方法二:手动添加vc143工具集配置
若方法一无效,可手动修改Boost的工具集配置文件:- 打开Boost根目录下的
tools/build/src/tools/msvc.jam文件 - 找到版本映射代码块,添加
vc143对应配置:versions = 14.3 : vc143 ; 14.2 : vc142 ; 14.1 : vc141 ; 14.0 : vc14 ; 12.0 : vc12 ; - 保存文件后,执行命令:
bootstrap.bat vc143
- 打开Boost根目录下的
额外检查
确认VS2022已安装C++桌面开发组件,缺失该组件会导致工具集无法被正常检测。
内容的提问来源于stack exchange,提问作者Anees
相关产品推荐
相关产品推荐

