我试图在Linux中安装mosquitto-1.3,这样做是为了实现这一目标。
1- wget http://mosquitto.org/files/source/mosquitto-1.3.tar.gz
2- tar -zxvf mosquitto-1.3.tar.gz
3- cd mosquitto-1.3
4- cmake .
5- make install
然后它开始很好但在中间它会断开并显示错误。
[root@localhost mosquitto-1.3]# make install
Scanning dependencies of target libmosquitto<br/>
[ 2%] Building C object lib/CMakeFiles/libmosquitto.dir/logging_mosq.c.o<br/>
[ 4%] Building C object lib/CMakeFiles/libmosquitto.dir/memory_mosq.c.o<br/>
[ 6%] Building C object lib/CMakeFiles/libmosquitto.dir/messages_mosq.c.o<br/>
[ 8%] Building C object lib/CMakeFiles/libmosquitto.dir/mosquitto.c.o<br/>
[ 10%] Building C object lib/CMakeFiles/libmosquitto.dir/net_mosq.c.o<br/>
[ 13%] Building C object lib/CMakeFiles/libmosquitto.dir/read_handle.c.o<br/>
[ 15%] Building C object lib/CMakeFiles/libmosquitto.dir /read_handle_client.c.o<br/>
[ 17%] Building C object lib/CMakeFiles/libmosquitto.dir /read_handle_shared.c.o<br/>
[ 19%] Building C object lib/CMakeFiles/libmosquitto.dir/send_client_mosq.c.o<br/>
[ 21%] Building C object lib/CMakeFiles/libmosquitto.dir/send_mosq.c.o<br/>
[ 23%] Building C object lib/CMakeFiles/libmosquitto.dir/srv_mosq.c.o<br/>
[ 26%] Building C object lib/CMakeFiles/libmosquitto.dir/thread_mosq.c.o<br/>
[ 28%] Building C object lib/CMakeFiles/libmosquitto.dir/time_mosq.c.o<br/>
[ 30%] Building C object lib/CMakeFiles/libmosquitto.dir/tls_mosq.c.o<br/>
[ 32%] Building C object lib/CMakeFiles/libmosquitto.dir/util_mosq.c.o<br/>
[ 34%] Building C object lib/CMakeFiles/libmosquitto.dir/will_mosq.c.o<br/>
Linking C shared library libmosquitto.so<br/>
/usr/bin/ld: cannot find -lcares<br/>
collect2: ld returned 1 exit status<br/>
make[2]: *** [lib/libmosquitto.so.1.3] Error 1<br/>
make[1]: *** [lib/CMakeFiles/libmosquitto.dir/all] Error 2<br/>
make: *** [all] Error 2<br/>
我能做些什么......帮助我......谢谢。
答案 0 :(得分:1)
您的系统上似乎没有安装 c-ares 。请参阅源代码树中的 compiling.txt 文件。
The following packages are required for mosquitto:
* tcp-wrappers (optional, package name libwrap0-dev)
* openssl (version 1.0.0 or greater if TLS-PSK support is needed, can be disabled)
* c-ares (for DNS-SRV support, can be disabled)
* libuuid (from e2fsprogs, can be disabled)
* On Windows, the Redhat pthreads library is required if threading support is
to be included.
To compile, run "make", but also see the file config.mk for more details on the
various options that can be compiled in.
Where possible use the Makefiles to compile. This is particularly relevant for
the client libraries as symbol information will be included. Use cmake to
compile on Windows or Mac.
If you have any questions, problems or suggestions (particularly related to
installing on a more unusual device like a plug-computer) then please get in
touch using the details in readme.txt.