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 命令就可以看到),但是還是需要安裝開發版本才行,否則會提示一大堆環境變量無法識別的錯誤:比如
cmake .. (如果沒有cmake,先安裝yum install cmake)
make
make install
以下是我編譯好的c++版本的庫文件

