For some reasons I can't explain, I had to make some little modifications in the source code of the downloaded libraries. Here are the steps I followed:
- Following the recommendations at: https://stackoverflow.com/questions/48701475/qt-creator-adding-mqtt-library, I executed the following commands:
-
git clone git://code.qt.io/qt/qtmqtt.git
-
qmake
make
make install
-
- When I typed the "make" command, some errors appeared (I need to clarify that I entirely installed QT creator and other packets from Debian official repositories (apt-get). The first issue was that I did not have installed packages qtbase5-private-dev and libqt5websockets5-dev (maybe I needed to install qtdeclarative5-dev).
- This solved the dependencies issues, but compilation errors like this remained: qmqtttopicfilter.cpp:206:26: error: no match for ‘operator==’ (operand types are ‘QString’ and ‘QLatin1Char’)
|| d->filter == QLatin1Char('#') - Following the same recommendations, I opened the qtmqtt.pro file with my QT and made the following modifications at the qmqtttopicfilter.cpp file:
- || d->filter == QLatin1Char('#') --------------------> || d->filter[0] == QLatin1Char('#')
- if (level != QLatin1Char('+') && level != topicLevels.at(i)) --------------------------> if (level[0] != QLatin1Char('+') && level != topicLevels.at(i))
- Voilà.. the problem is fixed and now it can be compiled. Then I tested the result with the subscriptions example.