问题描述
如何判断哪些boost库支持Header-Only?
解决方法
-
下载boost库,官方下载地址:https://www.boost.org/users/history/
-
在库根目录下执行命令即可查看需要编译才可使用的库模块,即不在此列表内的支持
Header-Only- Windows
.\bootstrap.bat .\b2 --show-libraries - macOS& Linux
./bootstrap.sh --show-libraries
得到的结果如下,以Version 1.78.0为例测试:
The following libraries require building: - atomic - chrono - container - context - contract - coroutine - date_time - exception - fiber - filesystem - graph - graph_parallel - headers - iostreams - json - locale - log - math - mpi - nowide - program_options - python - random - regex - serialization - stacktrace - system - test - thread - timer - type_erasure - wave - Windows

要判断Boost库中哪些是Header-Only,需下载Boost并运行相应平台的bootstrap脚本,如Windows上的boostrap.bat或macOS/Linux上的bootstrap.sh,接着使用b2--show-libraries命令。结果显示需要编译的库,而不在此列表的就是Header-Only库,例如在Boost1.78.0中,atomic、chrono等是需要编译的库。
1238

被折叠的 条评论
为什么被折叠?



