c++ - 在 Release模式下构建 Boost

标签 c++ visual-c++ boost

这是 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
...

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

如何在 Release模式下构建 Boost?

或者只是在 Debug 模式下构建测试配置,而其余的实际上是在 Release 模式下?但这是为什么呢?我怎样才能在 Debug模式下进行配置测试构建?

特别是,在这种情况下,has_icu 失败,因为我在 Release模式 (/MD) 中构建了该库。

最佳答案

我找到了 BlueGo工具对构建 boost 很有帮助。您可以配置发布/ Debug模式,也可以选择其他配置。

关于c++ - 在 Release模式下构建 Boost,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25097007/

相关文章:

c++ - RegQueryValueEx 得到不正确的数据

c++ - 使用带空格的路径时出现 boost::filesystem::file_size 错误

c++ - 为什么这段代码会崩溃

c++ - 这是有效的 C 代码但不是有效的 C++ 代码?

visual-studio - 根据VC++编译器版本条件编译

c++ - 如何使用类似 boost.parameter 的语法获得更快的编译速度?

c++ - 为什么我的基于 C++ Clock() 的函数返回负值?

visual-c++ - CEdit 获得焦点时选择所有内容

c++ - 在 [现代] C++ 中通过 N 个变量进行范围/循环

c++ - 如何使用指定的编译器(例如 GCC)安装 Boost