安装的最新版本rabbitmq-c时最后编译时总是报错,报错如下
[ 91%] Building C object tools/CMakeFiles/amqp-publish.dir/publish.c.o
/usr/local/src/rabbitmq-c-master/tools/publish.c: In function ‘main’:
/usr/local/src/rabbitmq-c-master/tools/publish.c:108: error: ‘POPT_ARG_ARGV’ undeclared (first use in this function)
/usr/local/src/rabbitmq-c-master/tools/publish.c:108: error: (Each undeclared identifier is reported only once
/usr/local/src/rabbitmq-c-master/tools/publish.c:108: error: for each function it appears in.)
gmake[2]: *** [tools/CMakeFiles/amqp-publish.dir/publish.c.o] Error 1
gmake[1]: *** [tools/CMakeFiles/amqp-publish.dir/all] Error 2
gmake: *** [all] Error 2
查遍资料也没有解决这个问题,突然一想,要不换个老点的版本编译,结果就很顺利编译完成,附旧版本编译指令
cd /usr/local/src
yum install libtool autoconf cmake
wget https://github.com/alanxz/rabbitmq-c/archive/v0.8.0.tar.gz
tar zxvf v0.8.0.tar.gz
cd rabbitmq-c-0.8.0
autoreconf -i
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/rabbitmq-c
make && make install