Boost:bjam如何构建库名称?

26

我在查看jam文件时,了解库的名称是如何构造的。 例如:libboost_log-mgw46-mt-1_48.dll

我想忽略最后一部分,如何使用我构造的名称将-o参数传递给链接器。 我有几个版本,并且在一个大项目中进行链接强制我对项目文件进行更改,这需要在很多地方进行修改。

我的愿望是获得libboost_log.dll。我只是重命名,但在执行程序时,它会提示找不到 libboost_log-mgw46-mt-1_48.dll文件。

1个回答

34

Boost Bjam定义了3种不同的命名布局。引用放置在Jamroot文件中的帮助(我不知道是否有更好的在线文档):

Boost Bjam有三种不同的命名布局定义。引用放置在Jamroot文件中的帮助(我不知道是否有更好的在线文档):

#   --layout=<layout>       Determines whether to choose library names
#                           and header locations such that multiple
#                           versions of Boost or multiple compilers can
#                           be used on the same system.
#
#                               versioned - Names of boost binaries
#                               include the Boost version number, name and
#                               version of the compiler and encoded build
#                               properties.  Boost headers are installed in a
#                               subdirectory of <HDRDIR> whose name contains
#                               the Boost version number.
#
#                               tagged -- Names of boost binaries include the
#                               encoded build properties such as variant and
#                               threading, but do not including compiler name
#                               and version, or Boost version. This option is
#                               useful if you build several variants of Boost,
#                               using the same compiler.
#
#                               system - Binaries names do not include the
#                               Boost version number or the name and version
#                               number of the compiler.  Boost headers are
#                               installed directly into <HDRDIR>.  This option
#                               is intended for system integrators who are
#                               building distribution packages.
#
#                           The default value is 'versioned' on Windows, and
#                           'system' on Unix.

使用system布局可以得到您想要的命名方案 - 只有普通的基本名称,没有其他信息。

根据这些布局生成Boost输出文件的名称是使用tag规则生成的,该规则在boostcpp.jam文件中定义。


17
我很不爽这个在Stack Overflow上更容易找到,而在Boost文档中却很难找。 - iAdjunct

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接