参照 README 中方法,安装所需库:
$ apt-get install build-essential gcc make cmake cmake-gui cmake-curses-gui
$ apt-get install fakeroot devscripts dh-make lsb-release
$ apt-get install libssl-dev
$ apt-get install doxygen graphviz
问题 无法编译出 libpaho-mqtt3as.so 等库
原因分析:ssl 环境问题,但在其他设备中编译均可正常编译所有库,NANO 中需显式调用
解决方法:显式调用
root@ubuntu:/home/paho.mqtt.c/build# cmake .. -DPAHO_WITH_SSL=1
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- CMake version: 3.13.1
-- CMake system name: Linux
-- Timestamp is 2024-10-21T06:04:25Z
-- Found OpenSSL: /usr/local/lib/libcrypto.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/paho.mqtt.c/build
root@ubuntu:/homepaho.mqtt.c/build#
注意:前提是已经安装过ssl
ubuntu 直接安装openssl(不能用时,编译 wget https://www.openssl.org/source/openssl-3.0.1.tar.gz )
显式调用后编译正常:

5056

被折叠的 条评论
为什么被折叠?



