c++ - 无法构建 boost 1.64.0 b2.exe Visual Studio 2017

标签 c++ boost visual-studio-2017

我正在按照这些说明进行操作

https://studiofreya.com/2017/04/23/building-boost-1-64-with-visual-studio-2017/

用于在 Windows 10 上构建 boost。这表明我们现在可以使用 2017 构建 boost?自此 question 以来的变化

    @echo off
rem Directory to boost root
set boost_dir=C:\Program Files\boost_1_64_0

rem Number of cores to use when building boost
set cores=%NUMBER_OF_PROCESSORS%

rem What toolset to use when building boost.

rem Visual Studio 2012 -> set msvcver=msvc-11.0
rem Visual Studio 2013 -> set msvcver=msvc-12.0
rem Visual Studio 2015 -> set msvcver=msvc-14.0
rem Visual Studio 2017 -> set msvcver=msvc-14.1

set msvcver=msvc-14.1

rem Start building boost
echo Building %boost_dir% with %cores% cores using toolset %msvcver%.

cd %boost_dir%
call bootstrap.bat

rem Static libraries
b2 -j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64 
b2 -j%cores% toolset=%msvcver% address-model=32 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/win32

rem Build DLLs
rem b2 -j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=shared threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64 
rem b2 -j%cores% toolset=%msvcver% address-model=32 architecture=x86 link=shared threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/win32

pause

从 Visual Studio 2017 命令行中运行。

Boostrap.bat 似乎运行良好。

enter image description here

我第一次运行 b2.exe 时,只有少数成功。我可以一次又一次地看到相同类型的错误。

...failed compile-c-c++ bin.v2\libs\serialization\build\msvc-14.1\release\address-model-32\architecture-x86\link-static\threading-multi\xml_oarchive.obj...
compile-c-c++ bin.v2\libs\serialization\build\msvc-14.1\release\address-model-32\architecture-x86\link-static\threading-multi\codecvt_null.obj
Files\boost_1_64_0""=="" was unexpected at this time.

任何有经验的人都可以解释这里所有的否定吗?它还给出了一些解析错误

C:\Program Files\boost_1_64_0>b2.exe
Files\boost_1_64_0""=="" was unexpected at this time.
Files\boost_1_64_0""=="" was unexpected at this time.
Files\boost_1_64_0""=="" was unexpected at this time.
Performing configuration checks
- 32-bit                   : no  (cached)
- 64-bit                   : no  (cached)
- arm                      : no  (cached)
- mips1                    : no  (cached)
- power                    : no  (cached)
- sparc                    : no  (cached)
- x86                      : no  (cached)
- combined                 : no  (cached)

Building the Boost C++ Libraries.

- symlinks supported       : yes
- C++11 mutex              : no
- Boost.Config Feature Check: cxx11_auto_declarations : no
- Boost.Config Feature Check: cxx11_constexpr : no
- Boost.Config Feature Check: cxx11_defaulted_functions : no
- Boost.Config Feature Check: cxx11_final : no
- Boost.Config Feature Check: cxx11_hdr_mutex : no
- Boost.Config Feature Check: cxx11_hdr_tuple : no
- Boost.Config Feature Check: cxx11_lambdas : no
- Boost.Config Feature Check: cxx11_noexcept : no
- Boost.Config Feature Check: cxx11_nullptr : no
- Boost.Config Feature Check: cxx11_rvalue_references : no
- Boost.Config Feature Check: cxx11_template_aliases : no
- Boost.Config Feature Check: cxx11_thread_local : no
- Boost.Config Feature Check: cxx11_variadic_templates : no
- 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
- zlib                     : no
- bzip2                    : no
- iconv (libc)             : no
- iconv (separate)         : no
- icu                      : no
- icu (lib64)              : no
- native-atomic-int32-supported : no
- message-compiler         : no
- native-syslog-supported  : no
- pthread-supports-robust-mutexes : no
- compiler-supports-visibility : no
- gcc visibility           : no
- long double support      : no

warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
    - zlib                     : no  (cached)
    - bzip2                    : no  (cached)

组件配置:

- atomic                   : building
- chrono                   : building
- container                : building
- context                  : building
- coroutine                : building
- coroutine2               : building
- date_time                : building
- exception                : building
- fiber                    : building
- filesystem               : building
- graph                    : building
- graph_parallel           : building
- iostreams                : building
- locale                   : building
- log                      : building
- math                     : building
- metaparse                : building
- mpi                      : building
- program_options          : building
- python                   : building
- random                   : building
- regex                    : building
- serialization            : building
- signals                  : building
- system                   : building
- test                     : building
- thread                   : building
- timer                    : building
- type_erasure             : building
- wave                     : building

...patience...
...patience...

所有内容都应写入 C:\Program Files\boost_1_64_0\stage\win32\lib,但我看不到任何文件。

最佳答案

当然...

设置 boost_dir=C:\Program Files\boost_1_64_0

必须有 ""以避免中断。愚蠢的 window 。 设置 boost_dir="C:\Program Files\boost_1_64_0"

然后我们开始构建!

关于c++ - 无法构建 boost 1.64.0 b2.exe Visual Studio 2017,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44989615/

相关文章:

c++ - 嵌套模板 gcc 编译器 4.1.2 错误

c++ - 为什么不使用 boost::optional 作为更好的 scoped_ptr

c++ - c++中的 "int a, b =0"和 "int a =0; int b = 0"有什么区别?

c++ - 使用 Boost 处理流

C++11:boost::make_tuple 与 std::make_tuple 有何不同?

typescript - 不需要的 *.js 和 *.js.map 文件正在项目的某些区域从 .ts 生成

visual-studio - 在 Visual Studio 2017 中更改 RDLC 报告的 RDL 版本

c++ - 构建解决方案时使 Visual Studio 的 CMake 工具运行 INSTALL

c++ - 如何正确检查(常量)重载方法

c++ - glDrawElements 不渲染任何东西