php网站设计要学多久,如何设计服装网站首页,百度推广app,大连建设工程设计院有限公司网站文章目录 [toc]1、概述2、下载QtMqtt源码3、编译4、验证5、参考6、视频 更多精彩内容#x1f449;内容导航 #x1f448;#x1f449;Qt网络编程 #x1f448; 1、概述 Qt默认是不包含mqtt库的#xff0c;如果需要使用到mqtt库就只能自己编译配置#xff1b; 网络所有的… 文章目录 [toc]1、概述2、下载QtMqtt源码3、编译4、验证5、参考6、视频
更多精彩内容内容导航 Qt网络编程 1、概述 Qt默认是不包含mqtt库的如果需要使用到mqtt库就只能自己编译配置 网络所有的QtMqtt配置的文章都是编译完成手动复制非常麻烦对新手也非常不友好吗容易漏了一些步骤 本文中主要说明如何自动编译配置QtMqtt无需手动拷贝、生成帮助手册 注意 编译前需要安装sudo apt install perl如果没有perl则编译后生成的头文件都是带.h后缀的。 演示环境
环境版本相同ubuntu22.04Qt5.14.2QtMqtt5.14.2
2、下载QtMqtt源码
命令行下载下载完成后选择QtMqtt版本与Qt版本相同或者相近
git clone https://github.com/qt/qtmqtt.git
git clone http://code.qt.io/qt/qtmqtt.git
git clone https://code.qt.io/qt/qtmqtt.gitgit tag # 查看分支
git checkout 5.14.2 # 切换分支浏览器下载 3、编译
使用qtcreator打开qtmqtt.proqtcreator如果不是使用sudo权限运行则下面的2、3步需要自己打开终端运行命令行添加编译配置 选择【项目】【构建】【添加构建步骤】【make】第一个在make参数项添加docs用于生成帮助手册第二个在make参数项添加install_docs用于自动安装帮助手册需要管理员权限第三个在make参数项添加install用于自动安装编译好的qtmqtt需要管理员权限 编译报错是因为使用make install_docs安装没有权限
19:57:10: 正在启动 /usr/bin/make install_docs -j16cd src/ ( test -e Makefile || /opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake -o Makefile /home/mhf/qtmqtt/src/src.pro -spec linux-g CONFIGdebug CONFIGqml_debug ) /usr/bin/make -f Makefile install_docs
make[1]: Entering directory /home/mhf/qtmqtt/build/gcc64-Debug/src
cd mqtt/ ( test -e Makefile || /opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake -o Makefile /home/mhf/qtmqtt/src/mqtt/mqtt.pro -spec linux-g CONFIGdebug CONFIGqml_debug ) /usr/bin/make -f Makefile install_docs
make[2]: Entering directory /home/mhf/qtmqtt/build/gcc64-Debug/src/mqtt
/opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake -install qinstall /home/mhf/qtmqtt/build/gcc64-Debug/doc/qtmqtt /opt/Qt5.14.2/Docs/Qt-5.14.2/qtmqtt
/opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake -install qinstall /home/mhf/qtmqtt/build/gcc64-Debug/doc/qtmqtt.qch /opt/Qt5.14.2/Docs/Qt-5.14.2/qtmqtt.qch
Error copying /home/mhf/qtmqtt/build/gcc64-Debug/doc/qtmqtt.qch to /opt/Qt5.14.2/Docs/Qt-5.14.2/qtmqtt.qch: Destination file exists
Error copying /home/mhf/qtmqtt/build/gcc64-Debug/doc/qtmqtt/examples-manifest.xml to /opt/Qt5.14.2/Docs/Qt-5.14.2/qtmqtt/examples-manifest.xml: Destination file exists
make[2]: *** [Makefile:2947: install_inst_qch_docs] Error 3
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory /home/mhf/qtmqtt/build/gcc64-Debug/src/mqtt
make[2]: *** [Makefile:2938: install_inst_html_docs] Error 3
make[1]: Leaving directory /home/mhf/qtmqtt/build/gcc64-Debug/src
make[1]: *** [Makefile:540: sub-mqtt-install_docs] Error 2
make: *** [Makefile:597: sub-src-install_docs] Error 2
19:57:11: 进程/usr/bin/make退出退出代码 2 。
Error while building/deploying project qtmqtt (kit: gcc64)
When executing step Make打开终端进入编译路径下再使用sudo make install、sudo make install_docs进行安装。 4、验证
将qtmqtt\examples\mqtt路径下的示例工程复制 出来使用qtcreator打开进行编译。如果不复制到qtmqtt工程外可能无法编译。 编译成功后如下所示 使用qtmqtt只需要在pro文件中添加QT mqtt就可以引入。 5、参考
qt/qtmqtt.git - Qt Module to implement MQTT protocol version 3.1 and 3.1.1 http://mqtt.org/GitHub - qt/qtmqtt: Qt Module to implement MQTT protocol version 3.1 and 3.1.1 http://mqtt.org/
6、视频 linux下qt5全自动编译配置qtmqtt