简体   繁体   English

最小的boost.org包括只使用一个子库

[英]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是要走的路。

You can find it here . 你可以在这里找到它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 子库中对函数的未定义引用 - Undefined references to functions in sub-library Boost.org提供的Boost Log 1.65.0示例的链接错误 - Linkage error with Boost Log 1.65.0 example from the Boost.org 在 Windows 上编译 webrtc 期间如何避免子库聚合? - How to avoid sub-library aggregation during webrtc compilation on Windows? Dev-C ++ / TDM-GCC:Boost Libaries的链接问题从boost.org下载 - Dev-C++/TDM-GCC: Linkage Problems with Boost Libaries Downloaded from boost.org boost.org的Spirit解析器 - 生成器框架有哪些缺点? - What are the disadvantages of the Spirit parser-generator framework from boost.org? bcp(Boost)复制最小子集库依赖项 - bcp (Boost) to copy a minimal subset library dependency 如何使用boost lexical_cast库来检查输入 - How to use the boost lexical_cast library for just for checking input 使用boost accumulators库有哪些正确的选择? - What are the right includes for using the boost accumulators library? boost图形库 - 顶点颜色和graphviz输出的最小示例 - boost graph library - minimal example of vertex colors and graphviz output 如何将 boost::serialization 与嵌套结构和最少的代码更改一起使用? - How to use boost::serialization with nested structs and minimal code changes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM