編譯mosquitto出現的問題


 

  1. [root@localhost mosquitto-1.3]# make WITH_TLS=no  

  2. set -e; for d in lib client src; do make -C ${d}; done  

  3. make[1]: Entering directory `/qyl/mosquitto-1.3/lib'  

  4. cc -Wall -ggdb -O2  -I. -I.. -I../lib -fPIC -DWITH_THREADING -DWITH_SRV -c mosquitto.c -o mosquitto.o  

  5. In file included from mosquitto.c:46:  

  6. mosquitto_internal.h:51:20: error: ares.h: No such file or directory  

  7. In file included from mosquitto.c:46:  

  8. mosquitto_internal.h:238: error: expected specifier-qualifier-list before ?.res_channel?  

  9. mosquitto.c: In function ?.osquitto_loop?.  

  10. mosquitto.c:834: error: ?.truct mosquitto?.has no member named ?.chan?  

  11. mosquitto.c:837: warning: implicit declaration of function ?.res_fds?  

  12. mosquitto.c:837: error: ?.truct mosquitto?.has no member named ?.chan?  

  13. mosquitto.c:917: error: ?.truct mosquitto?.has no member named ?.chan?  

  14. mosquitto.c:918: warning: implicit declaration of function ?.res_process?  

  15. mosquitto.c:918: error: ?.truct mosquitto?.has no member named ?.chan?  

  16. make[1]: *** [mosquitto.o] Error 1  

  17. make[1]: Leaving directory `/qyl/mosquitto-1.3/lib'  

  18. 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

  1. # Build with SRV lookup support.  

  2. WITH_SRV:=no  


再執行make,就可以順利安裝了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM