编译rabbitmq c++客户端

rabbitmq官网地址

rabbitmq客户端 c++版本地址

rabbitmq客户端 c版本地址

 

下载c++版本:根据编译说明

Pre-requisites

  • boost-1.47.0 or newer (uses chrono, system internally in addition to other header based libraries such as sharedptr and noncopyable)
  • rabbitmq-c you'll need version 0.5.1 or better.
  • cmake 2.8+ what is needed for the build system
  • Doxygen OPTIONAL only necessary to generate API documentation

所以1:去boost官网下载大于1.47.0的版本,我下的是boost_1_60_0.tar.bz2并编译安装

    ./bootstrap.sh --prefix=/usr/local/boost-1.60.0

     sudo ./b2 install

     cp -rf /usr/local/boost-1.60.0/include/boost  /usr/include

     cp -rf /usr/local/boost-1.60.0/lib /usr/lib 

     export Boost_LIBRARY_DIRS=/usr/lib

     cmake .. (如果没有cmake,先安装yum install cmake)

     make 

     make install

  2:下载rabbitmq-c,并编译安装

              需要openssl,所以先安装ssl开发包:yum install openssl-devel (unbuntu系统貌似为:sudo apt-get install libssl-dev 我的为rhel6.0)

    LINUX系统一般事先会安装openssl的发行版(用 openssl version -a 命令就可以看到),但是还是需要安装开发版本才行,否则会提示一大堆环境变量无法识别的错误:比如

    Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the system variable OPENSSL_ROOT_DIR (missing: OPENSSL_LIBRARIES OPENSSL_INCLUDE_DIR)
    然后, 

     cmake .. (如果没有cmake,先安装yum install cmake)

     make 

     make install

 

以下是我编译好的c++版本的库文件    

 

 
posted @ 2018-08-15 16:16  bigfi  阅读(3231)  评论(0编辑  收藏  举报