How can i add module mqtt to QT?
After I do all command
git clone https://github.com/emqtt/qmqtt.git
qmake -r ..
sudo make install
=> then i can complie the example code in source I download from git but when I create new project, in .pro I add line "QT += mqtt" then QT show me "Project ERROR: Unknown module(s) in QT: mqtt"
Hi and welcome to devnet,
This module is not an official Qt module so you should contact the authors of it.
As for the official QtMqtt module, it is located at http://code.qt.io/cgit/qt/qtmqtt.git/
Thank you for reply my question.
Is there any way to using it in QT ? because I see it has been added with the other QT module.
is github.com/emqtt a true Qt module ?
Looks to me as just an normal c++ lib/so/dll ?
To use such lib, one would just tell Creator via the .pro file
Key points being
INCLUDEPATH += xxxxxx/include
LIBS += -L"xxxx/lib" -lqtmqtt
The page do not seems to call it a module but I could be wrong.
You should load it or bind it to your project like @mrjj said.
btw. qtmqtt repository: I had some issues on building. After fixing that it worked - but is really in a early state. There is no support for proxy - so if you are behind a company proxy, there is no way to use the official MQTT client. Also the broker is just in work and not working yet.
Hope they will continue work on here, because I want to use a official module...
yep, it's all C++ file but how can I organize the folder in QT like that?
I search a lot, but I have only one answer in stackoverflow .
@alphaT Just create all these directories put the files there and edit your pro file to point to the files. Like:
SOURCES += src/main.cpp
thank for fast reply @jsulm , where can I create these directories?
I try to Add Existing Directory, but it doesn't seem to work.
@alphaT You can do it with any file manager on in a terminal
Thank all of you for your help.
INCLUDEPATH += ~/qmqtt/src/mqtt
LIBS += -L"~/qmqtt/src/mqtt" -lqmqtt
I just add two line to .pro file like you say above, and it works.
If you want the Qt Mqtt module that Qt Company is developing, that is here:
You need to clone: git://code.qt.io/qt/qtmqtt.git
This does install a module called 'mqtt'
@lorn.potter did you complie that source?
I try to complie it, but it's report error...
@alphaT Yes, I do compile that. I just did on Mac, with Qt 5.10
@lorn.potter 5.10 is the latest version?
I am using an older version, let me try QT 5.10.
@lorn.potter ops, still error too.
@alphaT It looks like you're building with Qt which is delivered by your Linux distribution (/usr/include/qt5).
I guess you simply called qmake from command line, right?
You should use complete path to qmake from Qt you installed: