1.下載rabbitmq-c勒葱,下載完成后解壓
https://github.com/alanxz/rabbitmq-c
2.下載rabbitmq-codegen
http://hg.rabbitmq.com/rabbitmq-codegen/
下載完成后解壓,將里面的內(nèi)容全復(fù)制到rabbitmq-c下面的codegen
3.安裝autotools
autotools包含以下工具
aclocal
autoscan
autoconf
autoheader
automake
使用which指令可測(cè)試是否已安裝
which aclocal
安裝指令
sudo apt-get install autoconf
4.在rabbitmq-c目錄下執(zhí)行以下指令
autoreconf -i
./configure
make
make install
5.測(cè)試是否成功
在一個(gè)terminal中執(zhí)行以下指令
./examples/amqp_listen localhost 5672 amq.direct test
在另一個(gè)terminal中執(zhí)行另一個(gè)指令
./examples/amqp_sendstring localhost 5672 amq.direct test "hello world"
此時(shí)前一個(gè)terminal會(huì)顯示相關(guān)的消息
6.出錯(cuò)情況
error: Libtool library used but 'LIBTOOL' is undefined
原因:未安裝libtoolize
安裝指令
sudo apt-get install libtool
syntax error near unexpected token `0.17'
`PKG_PROG_PKG_CONFIG(0.17)'
原因:未安裝pkg-config
安裝指令
sudo apt-get install pkg-config
7.相關(guān)參考
http://www.xuebuyuan.com/1355731.html
http://www.linuxidc.com/Linux/2009-10/22115.htm
http://blog.csdn.net/xiaoyur347/article/details/47038779
https://github.com/alanxz/rabbitmq-c/issues/110