当前位置:网站首页>Problem solving in the process of using mosquitto

Problem solving in the process of using mosquitto

2022-08-02 11:18:00 Little Monk Hanshui Temple Wuxin

1. To use mosquitto, either link its library files to compile, or download and install mosquitto on the system. After I installed it, I also successfully compiled my program. As a result, when running my executable file, it throwserror.
Insert image description here
The reason is that the system cannot find the library file during execution.One is to add the path of libmosquitto.so.1 in the environment variable, and the other is to add it to /usr/local/lib.After mosquitto is compiled and installed, libmosquitto.so.1 will be under the lib of mosquitto.I am using the second method.

First step

sudo cp libmosquitto.so.1 /usr/local/lib

Second step

sudo ln -s /usr/local/lib/libmosquitto.so.1 /usr/lib/libmosquitto.so.1 ldconfig
原网站

版权声明
本文为[Little Monk Hanshui Temple Wuxin]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/214/202208021117132995.html