Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How to build MQTT for android devices?
-
Hi all,
I am devlop an app use MQTT protocol to communicate server.
First I build and run MQTT on desktop OK.
Then, I tried to build with android device, I got errors mqtt module is unknown. Then I tried to build mqtt for android as desktop way, but when I run program, It had error
So I just wonder how to build MQTT correctly for Android?Info:
- Qt: 5.13.0
- OS: Ubuntu 18.04
- Project target: Android x86
- NDK: r20
-
@quang-phu said in How to build MQTT for android devices?:
o I just wonder how to build MQTT correctly for Android?
I guess that you need to follow the same procedure you did for building the module for Desktop, this time using the compiler/tools from the NDK
-
Hi @Pablo-J-Rogina,
I tried again, built as the procedure of Desktop one, there is an error:
cannot find -lc++
and this was fixed by adding -nostdlib++ into .../Qt5.13.0/5.13.0/android_x86/mkspecs/android-clang/qmake.conf as
https://codereview.qt-project.org/c/qt/qtbase/+/264903/9/mkspecs/android-clang/qmake.conf#34
Then building was successful, and it works now. I will mark this issue be resolved.
Thank for your help :)