当前位置:   article > 正文

paho mqtt c++库 交叉编译_mqtt c++交叉编译 支持mqtts

mqtt c++交叉编译 支持mqtts

1、gcc编译

1、官网地址
https://github.com/eclipse/paho.mqtt.cpp

2、编译
$ sudo apt-get install build-essential gcc make cmake cmake-gui cmake-curses-gui

$ sudo apt-get install libssl-dev 

$ sudo apt-get install doxygen graphviz

$ git clone https://github.com/eclipse/paho.mqtt.cpp
$ cd paho.mqtt.cpp

$ cmake -Bbuild -H. -DPAHO_BUILD_STATIC=ON \
    -DPAHO_BUILD_DOCUMENTATION=TRUE -DPAHO_BUILD_SAMPLES=TRUE
$ sudo cmake --build build/ --target install
$ sudo ldconfig

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

2、aarch64编译

# 设置环境变量依赖库路径
export CMAKE_LIBRARY_PATH=/root/test-2023-05-08/terminal_bak/lib_new:$CMAKE_LIBRARY_PATH

vi CMakeLists.txt
# 添加以下内容
set(CMAKE_SYSTEM_NAME Linux)
set(CMAKE_SYSTEM_PROCESSOR aarch64)
set(tools /root/t507/sdk_v2/V2.0/out/gcc-linaro-7.4.1-2019.02-x86_64_aarch64-linux-gnu)
set(CMAKE_C_COMPILER ${tools}/bin/aarch64-linux-gnu-gcc)
set(CMAKE_CXX_COMPILER ${tools}/bin/aarch64-linux-gnu-g++)
set(ROOT_DIR /root/test-2023-05-08/terminal_bak/lib_new)


mkdir build
cd build

cmake ..
make
make install
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Monodyee/article/detail/176507
推荐阅读
相关标签
  

闽ICP备14008679号