最小的boost.org包括仅使用一个子库 [英] Minimal boost.org includes to use just one sub-library
问题描述
我想使用 boost smart_ptr
图书馆.我不想要任何其他库,因为我试图使我的项目保持小规模.
I'd like to use the boost smart_ptr
library. I don't want any of the other libraries because I'm trying to keep my project small.
当我仅添加 smart_ptr
库时,我抱怨找不到 config.hpp
标头.我添加了该文件,然后我的编译器说找不到 assert.hpp
标头.之后,我放弃了,只包含了整个boost库.
When I added just the smart_ptr
library I got complaints that the config.hpp
header couldn't be found. I added that file then my compiler said it couldn't find the assert.hpp
header. I gave up after that and just included the entire boost library.
如果我想使用其中一个子库(例如 smart_ptr
),是否必须使用最少的Boost库集?
Is there a minimal set of boost libraries that must be used if I want to use one of the sub-libraries (e.g., smart_ptr
)?
我使用的 #include
语句是:
#include <boost/smart_ptr/shared_ptr.hpp>
我的目录结构如下
MyProject/
main.cpp
MyLib/
. . . My library code is here. . .
boost/
boost/
smart_ptr/
smart_ptr.hpp
. . . All other boost sub-libraries are also here. . .
推荐答案
实用程序 bcp
可用于提取boost头文件及其依赖项.
The utility bcp
can be used to extract a boost header and its dependencies.
提取单个库可能会有些复杂,因为未记录依赖项结构以及版本之间的更改. bcp
是必经之路.
Extracting single libraries can be a bit complicated because the dependency structure is not documented and changes between releases. bcp
is the way to go.
您可以在此处找到它.
这篇关于最小的boost.org包括仅使用一个子库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!