【问题标题】:build Boost in release mode在发布模式下构建 Boost
【发布时间】:2014-08-02 16:14:42
【问题描述】:

Boost 1.55.0 就是这样。

在 Cygwin shell 中,cmd /c "bootstrap.bat" 之后,我的命令是:

./b2 variant=release runtime-debugging=off -sICU_PATH=z:/icu-installed -sICU_LINK="/LIBPATH:z:\icu-installed\lib sicuuc.lib sicudt.lib sicuin.lib " --prefix=z:/boost-installed toolset=msvc link=static --without-python --reconfigure install

输出:

link.jam: No such file or directory
Performing configuration checks

    - 32-bit                   : yes
    - arm                      : no
    - mips1                    : no
    - power                    : no
    - sparc                    : no
    - x86                      : yes
    - has_icu builds           : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
...

bin.v2/config.log,我明白了:

...found 8 targets...
...updating 7 targets...
common.mkdir bin.v2
common.mkdir bin.v2\libs
common.mkdir bin.v2\libs\context
common.mkdir bin.v2\libs\context\config
common.mkdir bin.v2\libs\context\config\msvc-12.0
common.mkdir bin.v2\libs\context\config\msvc-12.0\debug
compile-c-c++ bin.v2\libs\context\config\msvc-12.0\debug\32.obj
32.cpp
...updated 7 targets...
...found 2 targets...
...updating 1 target...
...
common.mkdir bin.v2\libs\regex\build\msvc-12.0\debug
compile-c-c++ bin.v2\libs\regex\build\msvc-12.0\debug\has_icu_test.obj
has_icu_test.cpp
...
msvc.link bin.v2\libs\regex\build\msvc-12.0\debug\has_icu.exe
sicuuc.lib(udata.ao) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in has_icu_test.obj
sicuuc.lib(udata.ao) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in has_icu_test.obj
...

因此,出于某种原因,它在那里使用了调试设置。

如何在发布模式下构建 Boost?

或者只是配置测试在调试模式下构建,其余的实际上将在发布模式下?但这是为什么呢?以及如何在 Debug 模式下进行配置测试构建?

尤其是,在这种情况下,has_icu 失败,因为我已经在发布模式下构建了该库 (/MD)。

【问题讨论】:

    标签: c++ visual-c++ boost


    【解决方案1】:

    我发现BlueGo 工具对构建提升很有帮助。您可以配置发布/调试模式,也可以选择其他配置。

    【讨论】:

      猜你喜欢
      • 2014-08-18
      • 1970-01-01
      • 1970-01-01
      • 2018-08-19
      • 1970-01-01
      • 2021-04-14
      • 1970-01-01
      • 2012-03-12
      • 2018-09-06
      相关资源
      最近更新 更多