当你安装mosquitto1.4最新版本的时候或多或少会遇到问题。
我是用的centos系统,系统默许很多没有安装
假设你是ubuntu系统请使用 apt-get 代替yum
首先是安装各种工具
yum install gcc gcc-c++ libstdc++-devel
编译进程中问题:
1. ssh.h找不到
yum install openssl-devel
2.ares.h找不到
yum install c-ares-devel
3.如果你添加了websocket
借助git工具 yum install git
wget http://git.warmcat.com/cgi-bin/cgit/libwebsockets/snapshot/libwebsockets⑴.3-chrome37-firefox30.tar.gz
tar -zxvf libwebsockets⑴.3-chrome37-firefox30.tar.gz
cd libwebsockets⑴.3-chrome37-firefox30
mkdir build cd build cmake .. -DOPENSSL_ROOT_DIR=/usr/bin/openssl make sudo make install
4.uuid.h找不到
yum install libuuid-devel
5.mosquitto: error while loading shared libraries: libwebsockets.so.4.0.0: cannot open shared object file: No such file or directory
库的问题
sudo ln -s /usr/local/lib64/libwebsockets.so.4.0.0 /usr/lib/libwebsockets.so.4.0.0
还不行的话:
sudo vi /etc/ld.so.conf.d/lib64c.conf
…and add the following lines:-
# lib64c default configuration /usr/local/lib64…and then:-
sudo ldconfig