Ubuntu编译MongoDB client library

1.download cxx-driver for 1.8,unzip to /usr/src folder


2.sudo apt-get install libpcre3-dev


3.sudo apt-get install scons
chenshu@chenshu-ubuntu:/usr/local/src/mongo-cxx-driver-v1.8$
[plain] view plaincopyprint?
rm -f .sconsign.dblite 
scons --prefix=/usr install 
如有必要配置SConstruct文件,比如boost库位于/usr/lib下面的话,要将配置从/usr/local改为/usr

4.如果没有安装到/usr/lib目录下,则用下面命令复制一下
sudo cp libmongoclient.* /usr/lib/

5.如果开发的时候想调试进入源代码看看,需要在SConstruct文件中找到if linux,然后添加一行 -g参数。

if linux:
    env.Append( LINKFLAGS=" -Wl,--as-needed -Wl,-zdefs " )
    env.Append( CPPFLAGS=" -g " )

转自: http://blog.csdn.net/sheismylife/article/details/6745727

猜你喜欢

转载自huaxiamian.iteye.com/blog/1470885