11

我为 VS2013 构建了 Boost,64 位架构同时使用b2.exebjam.exe. 根据 Boost文档b2必须使用过bjam。我注意到的差异是:

  1. b2 中 .lib 文件的大小与相应 bjam 文件的大小不同。
  2. 使用 bjam 提供动态 .lib 库(没有 -s 标记,如此所述),但它不提供要链接到的 .dll 文件(那么现在该怎么办?),而使用 b2 提供静态和动态库以及.dll 文件。但是使用 b2 的问题是,它提供了两个动态 .lib 文件 - 一个以 boost_xxxx.lib 开头,另一个以 libboost_xxxx.lib 开头,两者的大小不同。这是为什么?

我还提到了使用构建选项的不同构建目录--build-dir,但是这个目录有什么用?它由 .obj、.rsp 以及各自的 .dll 和 .lib 文件组成。这个目录可以删除吗?

以下是我用来构建 Boost 的命令:

  1. 乙2:

    b2 toolset=msvc-12.0 --build-type=complete architecture=x86 address-model=32 install --build-dir=<build-dir> stage --stagedir=<stage-dir> -j2
    
  2. 果酱:

    bjam stage --stagedir=<stage-dir>
    
4

1 回答 1

8

b2 and bjam are identical files except for their names. The different results are a consequence of calling them with different arguments.

About the preferred name: calling ./b2 --help and ./bjam --help both yield the name b2.

于 2019-07-09T09:57:39.900 回答