【发布时间】:2012-02-10 21:37:44
【问题描述】:
我第一次尝试在 C++ 中使用 mongodb。我刚刚在 Ubuntu 上安装了最新版本,还安装了最新的 v2.0 c++ 驱动程序代码。它使用 scons 编译得很好。在 c++ 文件中,以下是我的包含。
#include <client/dbclient.h>
所以..我假设我必须对 boost 库进行引用,但我不知道该怎么做。
make all
Building target: rtb
Invoking: GCC C++ Linker
g++ -L/usr/local/include/ -L/home/boost -L/home/cpp/mongo-cxx-driver-v2.0/mongo -lfcgi++ -o"rtb" ./src/rtb.o
./src/rtb.o: In function `__static_initialization_and_destruction_0':
/home/boost/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/home/boost/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/home/boost/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [rtb] Error 1
【问题讨论】: