2014-04-09 48 views
5

我想使用boostsmart_ptr庫。我不想要任何其他庫,因爲我正在努力保持我的項目小。Minimal boost.org包括使用一個子庫

當我只添加smart_ptr庫時,我收到投訴,找不到config.hpp標題。我添加了該文件,然後我的編譯器說它找不到assert.hpp標題。之後我放棄了,只包括整個提升庫。

如果我想使用其中一個子庫(例如smart_ptr),是否需要使用最少的一組boost庫?

#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. . . 
+0

http://www.boost.org/doc/libs/1_55_0/tools/bcp/doc/html/index.html – pmr

+0

請顯示關聯的'#include'行。並解釋你的源代碼文件的佈局。 – wallyk

回答

9

效用bcp可被用來提取升壓頭和它的依賴。

提取單個庫可能有點複雜,因爲依賴關係結構沒有記錄,並且在版本之間發生變化。 bcp是要走的路。

你可以找到它here