当前位置: 首页 > news >正文

OpenHarmony 开源鸿蒙南向开发——linux下使用make交叉编译第三方库——mqtt库

    准备工作

请依照这篇文章搭建环境

OpenHarmony 开源鸿蒙南向开发——linux下使用make交叉编译第三方库——环境配置_openharmony交叉编译-CSDN博客

下载

wget ftp://ftp.gnutls.org/gcrypt/gnutls/v3.5/gnutls-3.5.9.tar.xz

解压

tar -xf 
mkdir ./out
cd ./out 

Cmake命令

这里需要更换一下目录

cmake .. \
-DPAHO_WITH_SSL=TRUE \
-DPAHO_BUILD_DOCUMENTATION=FALSE \
-DOPENSSL_ROOT_DIR=/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build \
-DOPENSSL_CRYPTO_LIBRARY=/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/lib/libcrypto.so \
-DOPENSSL_INCLUDE_DIR=/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/include \
-DOPENSSL_SSL_LIBRARY=/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/lib/libssl.so \
-DCMAKE_C_COMPILER="/home/vtstar/Desktop/openharmony/sdk/sdk_linux_5.0.0.71/native/llvm/bin/clang" \
-DCMAKE_CXX_COMPILER="/home/vtstar/Desktop/openharmony/sdk/sdk_linux_5.0.0.71/native/llvm/bin/clang++" \
-DCMAKE_LINKER="/home/vtstar/Desktop/openharmony/sdk/sdk_linux_5.0.0.71/native/llvm/bin/ld.lld" \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=arm \
-DCMAKE_C_FLAGS="-fPIC -D__MUSL__=1 -march=armv7a -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/Libunistring/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/nettle/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/libtasn/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gmp/out/32/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gettext/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/include --target=arm-linux-ohos" \
-DCMAKE_CXX_FLAGS="-fPIC -D__MUSL__=1 -march=armv7a -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/Libunistring/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/nettle/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/libtasn/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gmp/out/32/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gettext/out/32/build/include -I/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/include --target=arm-linux-ohos" \
-DCMAKE_EXE_LINKER_FLAGS="-L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gmp/out/32/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/Libunistring/out/32/build/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/nettle/out/32/build/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/libtasn/out/32/build/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/Libunistring/out/32/build/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/gettext/out/32/build/lib -L/home/vtstar/Desktop/openharmony/ThirtyPartRestore/openssl/openssl-1.1.1a/build/lib" \
-DCMAKE_INSTALL_PREFIX=./out

编译

cd ..
make -clean
make

编译成功

安装

make install

相关文章:

  • 时间序列预测建模的完整流程以及数据分析【学习记录】
  • 从零开始了解数据采集(二十七)——什么IIOT平台
  • 源码分析之Leaflet中GeoJSON模块
  • 信息学奥赛一本通 1535:【例 1】数列操作
  • 信奥赛-刷题笔记-队列篇-T2-P1540机器翻译和P2952Cow Line S
  • 品种亮相!贵州金桥药业筑牢市场竞争护城河
  • MATLAB语音情感识别神经网络方法
  • 从零开始:使用 Vue-ECharts 实现数据可视化图表功能
  • INT202 Complexity of Algroithms 算法的复杂度 Pt.7 NP-Completeness NP完全性
  • SwarmUI 基于.NET开发的开源AI图像生成WEB用户界面系统
  • 市政务服务技能竞赛流程策划方案
  • 【计算机视觉】OpenCV实战项目:基于Tesseract与OpenCV的字符识别系统深度解析
  • 第十七章:Llama Factory 深度剖析:易用性背后的微调框架设计
  • flutter Stream 有哪两种订阅模式。
  • 工作常用的git命令
  • Node.js中的洋葱模型
  • C++中的volatile有什么用?
  • PostgreSQL 恢复信息函数
  • flea-cache使用之Redis哨兵模式接入
  • ETL 数据集成平台与数据仓库的关系及 ETL 工具推荐
  • 美国明尼苏达州发生山火,过火面积超80平方公里
  • 中华人民共和国和巴西联邦共和国关于强化携手构建更公正世界和更可持续星球的中巴命运共同体,共同维护多边主义的联合声明
  • 王毅人民日报撰文:共商发展振兴,共建中拉命运共同体
  • 湛江霞山通报渔船火灾:起火船舶共8艘,无人员伤亡或被困
  • 陈宝良 高寿仙 彭勇︱明清社会的皇权、商帮与市井百态
  • 巴基斯坦外长:印巴已同意立即停火