C++ redis client安装全过程

1.下载:

C++版本的redis client下载链接:https://github.com/mrpi/redis-cplusplus-client


2.首先需要安装boost库,在linux下安装boost库过程如下:

   2.1 boost库下载到官网:http://www.boost.org/,当前最新版本为1.51.0

   2.2 安装命令:

    官网介绍:http://www.boost.org/doc/libs/1_51_0/more/getting_started/unix-variants.html

Select your configuration options and invoke ./bootstrap.sh again without the --help option. Unless you have write permission in your system's /usr/local/ directory, you'll probably want to at least use

$ ./bootstrap.sh --prefix=path/to/installation/prefix

to install somewhere else. Also, consider using the --show-libraries and --with-libraries=library-name-list options to limit the long wait you'll experience if you build everything. Finally,

$ ./b2 install

will leave Boost binaries in the lib/ subdirectory of your installation prefix. You will also find a copy of the Boost headers in the include/ subdirectory of the installation prefix, so you can henceforth use that directory as an #include path in place of the Boost root directory.

    所以,如果是有root权限,直接:

    $ ./bootstrap.sh --prefix=/usr/local

    $ ./b2 install

   安装过程中可能提示:

   安装过程中提示: patchlevel.h:没有那个文件或目录

   则:sudo apt-get install python-dev

   如果出现说: bzlib.h:没有那个文件或目录

   则:sudo apt-get install libbz2-dev 

然后重新调用$ ./b2 install,

视具体机器性能,编译可能需要十几分钟到半个小时不等。

   至此,boost安装完毕!


3. C++ client客户端安装

    正常make就可以了,不过可能出错:提示说找不到lboost_thread-mt,

 修改Makefile文件用VIM打开Makefile文件,把“lboost_thread-mt” 改成          
  “lboost_thread”保存重新make。
 然后./test_client运行,
 如果出现提示说不能找到libboost_system.so.1.51.0的错误:
则选择用root权限:
$ sudo ldconfig /usr/local/lib
(这是假设之前boost的库安装到了/usr/local目录下,
   如果是其它目录下,需要做相应的改动)
至此,大功告成!

http://blog.csdn.net/zhangcoldwater/article/details/7931533


你可能感兴趣的:(C++ redis client安装全过程)