[root@localhost mosquitto-1.3]# make WITH_TLS=no
set -e; for d in lib client src; do make -C ${d}; done
make[1]: Entering directory `/qyl/mosquitto-1.3/lib'
cc -Wall -ggdb -O2 -I. -I.. -I../lib -fPIC -DWITH_THREADING -DWITH_SRV -c mosquitto.c -o mosquitto.o
In file included from mosquitto.c:46:
mosquitto_internal.h:51:20: error: ares.h: No such file or directory
In file included from mosquitto.c:46:
mosquitto_internal.h:238: error: expected specifier-qualifier-list before ?.res_channel?
mosquitto.c: In function ?.osquitto_loop?.
mosquitto.c:834: error: ?.truct mosquitto?.has no member named ?.chan?
mosquitto.c:837: warning: implicit declaration of function ?.res_fds?
mosquitto.c:837: error: ?.truct mosquitto?.has no member named ?.chan?
mosquitto.c:917: error: ?.truct mosquitto?.has no member named ?.chan?
mosquitto.c:918: warning: implicit declaration of function ?.res_process?
mosquitto.c:918: error: ?.truct mosquitto?.has no member named ?.chan?
make[1]: *** [mosquitto.o] Error 1
make[1]: Leaving directory `/qyl/mosquitto-1.3/lib'
make: *** [mosquitto] Error 2
在lib/mosquitto_internal.h里面找到ares.h,发现这个头文件是由宏定义WITH_SRV控制的。
不知道SRV SUPPORT是什么东西,但是查看mosquitto的更新日志,发现SRV support是今年3月16号才添加上的,我说去年源码安装一直没问题,今年怎么就不行了。
解决办法,在config.mk配置文件里面把srv support 关掉。如下图:
[plain] view plaincopy
# Build with SRV lookup support.
WITH_SRV:=no
再执行make,就可以顺利安装了。