[英]Minimal boost.org includes to use just one sub-library
I'd like to use the boost smart_ptr
library. 我想使用boost
smart_ptr
库。 I don't want any of the other libraries because I'm trying to keep my project small. 我不想要任何其他库,因为我试图保持我的项目很小。
When I added just the smart_ptr
library I got complaints that the config.hpp
header couldn't be found. 当我添加
smart_ptr
库时,我得到了无法找到config.hpp
标头的抱怨。 I added that file then my compiler said it couldn't find the assert.hpp
header. 我添加了该文件,然后我的编译器说它无法找到
assert.hpp
标头。 I gave up after that and just included the entire boost library. 之后我放弃了,只包括了整个boost库。
Is there a minimal set of boost libraries that must be used if I want to use one of the sub-libraries (eg, smart_ptr
)? 如果我想使用其中一个子库(例如,
smart_ptr
),是否必须使用一组最小的boost库?
The #include
statement I use is: 我使用的
#include
语句是:
#include <boost/smart_ptr/shared_ptr.hpp>
The directory structure I have looks like this 我的目录结构看起来像这样
MyProject/
main.cpp
MyLib/
. . . My library code is here. . .
boost/
boost/
smart_ptr/
smart_ptr.hpp
. . . All other boost sub-libraries are also here. . .
The utility bcp
can be used to extract a boost header and its dependencies. 实用程序
bcp
可用于提取boost标头及其依赖项。
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. bcp
是要走的路。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.