参考:https://blog.csdn.net/a_bcd_123/article/details/69791934
1.下载源码
wget http://mosquitto.org/files/source/mosquitto-2.0.14.tar.gz
2.安装依赖库
yum install libssl-dev
yum install libc-ares-dev
yum install uuid-dev
yum install openssl-devel
yum install c-ares-devel
yum install libuuid-devel
3、编译
tar -zxvf mosquitto-2.0.14.tar.gz
cd mosquitto-2.0.14
4、错误
错误1
解决:
cJSON 库安装步骤如下: 参考cJSON的README说明安装
git clone https://github.com/DaveGamble/cJSON.git
cd cJSON/
mkdir build
cd build/
cmake .
sudo make install //因为要安装库到系统目录,最后这一步要有root权限才能执行