Ubuntu+QT+SSL+MQTT

Index of /archive/qt/5.14/5.14.2

https://mirrors.ustc.edu.cn/qtproject/archive/qt/5.14/5.14.2/qt-opensource-linux-x64-5.14.2.run

chmod u+x qt-opensource-linux-x64-5.14.2.run

sudo ./qt-opensource-linux-x64-5.14.2.run

/opt/Qt5.14.2

在终端输入:/opt/Qt5.14.2/Tools/QtCreator/bin/qtcreator.sh 

cd /opt/Qt5.14.2/Tools/QtCreator/bin/

./qtcreator.sh 

sudo apt-get install build-essential

sudo apt-get install mesa-common-dev

sudo apt-get install libglu1-mesa-dev

sudo apt-get install libfontconfig1

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa #添加源到软件仓库

sudo apt-get update #更新软件仓库列表

sudo apt-get install mosquitto #安装mosquitto

sudo service mosquitto status #查看运行状态

sudo service mosquitto start #启动服务

sudo service mosquitto stop #停止服务

sudo apt-get install iptables

iptables -I INPUT -p tcp --dport 1883 -j ACCEPT

iptables-save

sudo passwd

sudo apt-get install iptables-persistent

sudo netfilter-persistent save

sudo netfilter-persistent reload

sudo apt-get install mosquitto mosquitto-clients

mosquitto_sub -h localhost -t test
mosquitto_pub -h localhost -t test -m "hello world"

sudo apt install git

sudo apt install cmake

sudo apt-get install g++ sudo apt-get install libx11-dev libxext-dev libxtst-dev12

sudo apt install g++

sudo apt install libx11-dev

sudo apt install ibxext-dev

sudo apt install libxtst-dev12

git clone https://github.com/qt/qtmqtt

git clone GitHub - qt/qtmqtt: Qt Module to implement MQTT protocol version 3.1 and 3.1.1 http://mqtt.org/

git checkout 5.14.2

cd qtmqtt

qmake

make

make install

/opt/Qt5.14.2/5.14.2/gcc_64/include

sudo mkdir QtMqtt

cp -r code.zip /opt/Qt5.14.2/5.14.2/gcc_64/include

chuangxin@chuangxin:~/qtmqtt/src/mqtt$

sudo cp -r *.h /opt/Qt5.14.2/5.14.2/gcc_64/include/QtMqtt

sudo cp -r *.cpp /opt/Qt5.14.2/5.14.2/gcc_64/include/QtMqtt

https://github.com/emqx/qmqtt.git

sudo vim /etc/profile

export PATH=/opt/Qt5.14.2/Tools/QtCreator/bin:$PATH
export QTDIR=/opt/Qt5.14.2/5.14.2/gcc_64
export PATH=$QTDIR/bin:$PATH
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH

source /etc/profile

chuangxin@chuangxin:~$ qtchooser -l

4

5

default

qt4-x86_64-linux-gnu

qt4

qt5-x86_64-linux-gnu

qt5

chuangxin@chuangxin:~$

qtchooser -install qt5.14  /opt/Qt5.14.2/5.14.2/gcc_64/bin/qmake

export QT_SELECT=qt5.14

qtchooser –l  

1. 下载 emqx-ee-4.4.11-otp24.3.4.2-1-ubuntu18.04-amd64.deb SHA256

wget https://www.emqx.com/zh/downloads/enterprise/4.4.11/emqx-ee-4.4.11-otp24.3.4.2-1-ubuntu18.04-amd64.deb

2. 安装

sudo apt install ./emqx-ee-4.4.11-otp24.3.4.2-1-ubuntu18.04-amd64.deb

3. 运行

sudo systemctl start emqx

cd emqx

./emqx/bin/emqx start

./emqx/bin/emqx start

chuangxin@chuangxin:~/下载$ ./emqx/bin/emqx start

ERROR: /home/chuangxin/下载/emqx/erts-12.3.2.2/bin/erl: 1: /home/chuangxin/下载/emqx/erts-12.3.2.2/bin/erl: Syntax error: Unterminated quoted string

ERROR: Please ensure it is running on the correct platform:

ERROR: arch: "aarch64-unknown-linux-gnu"

wordsize: 64

os: "ubuntu18.04"

erlang: "24.3.4.2-1"

elixir: "none"

relform: "tgz"

ERROR: Version=5.0.13

ERROR: Required dependencies: openssl-1.1.1 (libcrypto), libncurses and libatomic1

chuangxin@chuangxin:~/

chuangxin@chuangxin:~/下载$ ./emqx/bin/emqx start

ERROR: /home/chuangxin/下载/emqx/erts-12.3.2.2/bin/erl: 1: /home/chuangxin/下载/emqx/erts-12.3.2.2/bin/erl: Syntax error: Unterminated quoted string

ERROR: Please ensure it is running on the correct platform:

ERROR: arch: "aarch64-unknown-linux-gnu"

wordsize: 64

os: "ubuntu18.04"

erlang: "24.3.4.2-1"

elixir: "none"

relform: "tgz"

ERROR: Version=5.0.13

ERROR: Required dependencies: openssl-1.1.1 (libcrypto), libncurses and libatomic1

chuangxin@chuangxin:~/下载$

https://www.openssl.org/source/

openssl version

wget https://www.openssl.org/source/openssl-1.1.1q.tar.gz

tar xvf openssl-1.1.1q.tar.gz && cd openssl-1.1.1q

sudo apt install -y perl gcc make

./config

make

sudo make install

su – root

sudo echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:/usr/local/lib" >> /etc/profile

source /etc/profile

https://www.openssl.org/source/openssl-1.1.1h.tar.gz

tar -xzvf openssl-1.1.1h.tar.gz

cd openssl-1.1.1h

make

sudo make install

sudo mv /usr/bin/openssl /usr/bin/openssl.old //将旧版本的openssl进行备份

sudo ln -s /usr/local/bin/openssl /usr/bin/openssl //将新版本的openssl进行软链接

cd /etc/ //进入etc目录

su //下一步一定要切换到root用户

echo "/usr/local/lib" >> ld.so.conf //openssl的安装路径加入配置中

ldconfig //重新加载配置

openssl version

sudo apt-get install libssl-dev

sudo apt-get install openssl libssl-dev -y

解决方法:

apt-get install libssl1.1=1.1.1-1ubuntu2.1~18.04.17

sudo apt-get install libtool

sudo apt-get install libpcre3 libpcre3-dev

wget http://nginx.org/download/nginx-1.14.0.tar.gz

tar -zxvf nginx-1.14.0.tar.gz

cd nginx-1.14.0

./configure --prefix=/usr/local/nginx 

sudo apt install nginx

./nginx

sudo apt-get install openjdk-8-jdk

java -version

sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev libgl1-mesa-dev libxml2-utils xsltproc unzip

sudo apt-get install dosfstools e2fsprogs parted

Download Android Studio & App Tools - Android Developers

cd ~/下载
sudo cp android-studio-ide-191.5977832-linux.tar.gz /usr/local  //这里要root权限 
sudo tar -zxvf android-studio-ide-191.5977832-linux.tar.gz  //解压

tar -zxvf android-studio-2021.3.1.17-linux.tar.gz

cd android-studio/bin

./studio.sh

sudo apt-get install android-sdk 

mirrors.opencas.org:80

git config --global core.editor vim
git config --global credential.helper store
sudo apt-get update
sudo apt install python libssl-dev python-crypto samba  openssh-server libncurses5 libncurses5:i386 gitk   net-tools  flameshot vim ccache
sudo usermod -aG plugdev $LOGNAME

sh <(curl -q https://platform.activestate.com/dl/cli/_pdli01/install.sh) -c'state activate --default ActiveState-Projects/ActiveState-Perl-5.36.0'

chuangxin@chuangxin:~$ sh <(curl -q https://platform.activestate.com/dl/cli/_pdli01/install.sh) -c'state activate --default ActiveState-Projects/ActiveState-Perl-5.36.0'
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  4652    0  4652    0     0   4372      0 --:--:--  0:00:01 --:--:--  4372
chuangxin@chuangxin:~$ perl -v

This is perl 5, version 26, subversion 1 (v5.26.1) built for x86_64-linux-gnu-thread-multi
(with 78 registered patches, see perl -V for more detail)

Copyright 1987-2017, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

chuangxin@chuangxin:~$ 


    [Desktop Entry]
    Name=AndroidStudio
    Comment=AndroidStudio
    Exec=/home/chuangxin/android-studio/bin/studio.sh 
    Icon=/home/chuangxin/android-studio/bin/studio.png 
    Terminal=false
    Type=Application

sudo gedit /etc/profile

export PATH=/opt/Qt5.14.2/Tools/QtCreator/bin:$PATH
export QTDIR=/opt/Qt5.14.2/5.14.2/gcc_64
export PATH=$QTDIR/bin:$PATH:
export LD_LIBRARY_PATH=$QTDIR/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

export NDK_HOME=/home/chuangxin/Android/Sdk/ndk/25.1.8937393
export PATH=$NDK_HOME:$PATH


source /etc/profile

ndk-build -v

chuangxin@chuangxin:~$ ndk-build -v
GNU Make 4.3
x86_64-pc-linux-gnu 编译
Copyright (C) 1988-2020 Free Software Foundation, Inc.
许可证:GPLv3+GNU 通用公共许可证第 3 版或更新版本<http://gnu.org/licenses/gpl.html>
本软件是自由软件:您可以自由修改和重新发布它。
在法律允许的范围内没有其他保证。
chuangxin@chuangxin:~$ 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
移植Qt MQTT 到 ARM Linux 平台上需要以下几个步骤: 1. 安装交叉编译工具链:在Linux下,我们需要安装适用于ARM架构的交叉编译工具链,例如arm-linux-gnueabihf。这个工具链将会提供编译Qt和其它依赖库所需的工具和环境。 2. 下载Qt源码:从Qt官方网站上下载适用于ARM Linux的Qt源码。选择适合您的版本和需要的模块。确保选择支持MQTT的模块。 3. 配置编译选项:解压源码后,使用命令行进入源码目录。运行`configure`脚本来配置编译选项,例如指定交叉编译工具链和目标平台。确保选择MQTT模块和适当的依赖库,在这种情况下是Paho MQTT C库和OpenSSL库。 4. 运行make:在配置完成后,运行`make`命令来编译Qt源码。这个过程可能会需要一段时间,具体取决于您的电脑性能和源码大小。 5. 安装Qt:编译完成后,使用`make install`命令来安装Qt到指定的路径。确保您选择正确的安装路径,以便在ARM Linux上使用。 6. 创建Qt MQTT项目:现在,您可以在ARM Linux上创建基于Qt MQTT的项目了。使用Qt Creator工具创建一个新项目,并在项目配置中添加必要的库和模块。确保设置正确的编译器和目标平台。 7. 编译和部署:通过Qt Creator编译和构建项目。然后,将生成的可执行文件和任何依赖的库文件复制到ARM Linux设备上。确保正确配置和安装依赖库,包括Paho MQTT C库和OpenSSL库。 8. 测试和调试:最后,在ARM Linux设备上运行和测试您的Qt MQTT应用程序。使用调试工具(例如GDB)来调试任何可能出现的问题,确保应用程序正常运行。 通过以上步骤,您应该能够成功将Qt MQTT移植到ARM Linux平台上,并在设备上运行和测试。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

疾风铸境

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值