You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Visual Studio 2019命令工具构建Boost时遇问题求助

Fixing Boost.Jam Build Failures in Visual Studio 2019

Let’s break down what’s going on here and fix it step by step:

Why This Happens

The warnings and build failure stem from outdated compiler options in Boost’s build scripts that Visual Studio 2019 no longer supports:

  • The /GZ flag was deprecated long ago—VS 2019 now uses /RTC1 for runtime debug checks
  • The /MLd flag (old single-threaded debug runtime library option) has been completely removed from VS 2019

Step-by-Step Solutions

1. Target the Correct VS 2019 Toolset During Bootstrapping

First, try running Boost’s bootstrap script explicitly for VS 2019’s toolset (vc142):

bootstrap.bat vc142

This tells the script to use VS 2019-compatible compiler options instead of falling back to outdated defaults.

2. Manually Update Compiler Options in the Bootstrap Script

If the above doesn’t work, edit the bootstrap.bat file in your Boost root directory:

  • Locate the section where cl.exe is called to compile Boost.Jam’s source files
  • Replace the deprecated /GZ flag with /RTC1
  • Remove the /MLd flag and replace it with a VS 2019-supported runtime option:
    • Use /MDd for multi-threaded debug DLL runtime (the most common choice)
    • Use /MTd for multi-threaded debug static runtime

Save the changes and re-run bootstrap.bat—this should compile Boost.Jam without the deprecated/unknown option errors.

3. Upgrade to a VS 2019-Compatible Boost Version

Older Boost versions (pre-1.70) don’t include support for VS 2019’s compiler changes. Upgrading to Boost 1.70 or later will resolve these issues out of the box, as the build scripts are updated to use modern VS options.

4. Use a Precompiled Boost.Jam Binary (Alternative)

If you’d rather skip compiling Boost.Jam yourself, grab a precompiled binary built for VS 2019. Replace the auto-generated bjam.exe with this precompiled version and proceed with your Boost build.

内容的提问来源于stack exchange,提问作者Sharad Suvagiya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 13:57:36