如何使用boost里的pool
我试着编译书上的例子的时候,编译器提示我“无法打开文件“libboost_thread-vc100-mt-sgd-1_51.lib””。
请问pool库要使用到线程吗?
还有一个问题,我使用了STLPort,然后也在编译器预编译定义里添加了_STL_DEBUG和__STLP_DEBUG,为什么需要打开的lib不是libboost_thread-vc100-mt-sgdp.lib?
下面是代码
#include <iostream>#include <boost/pool/pool.hpp>using namespace std ;using namespace boost;int main (){ pool<> pl (sizeof (int)) ; int * p = (int *) pl.malloc () ; pl.free (p) ; for (int i = 0; i < 100; ++ i) { pl.ordered_malloc (10) ; }}