KurtPattyn / QtAwsIoT

Qt library for accessing AWS IoT
MIT License
13 stars 5 forks source link

Usage with QtCreator #21

Open Nurhak opened 6 years ago

Nurhak commented 6 years ago

Hello,

Firstly thanks for that perfect library.

I have made a clean install QtMqtt library and QtAwsIoT library. But after I am trying to run the pubsub.cpp on QtCreator I got many error about undefined references. So at the below my really basic begining. Could you pls show a guide that can basically publish a message in any qt projects.

Here is my .pro file

QT += core QT -= gui

CONFIG += c++11

TARGET = aws_qt CONFIG += console CONFIG -= app_bundle

INCLUDEPATH += "/usr/local/include/QtMqtt/Qt5/" \ "/usr/local/include/" \ "/usr/local/include/QtAwsIoT/Qt5/"

TEMPLATE = app

SOURCES += main.cpp

LIBS += -L"/usr/local/lib/QtAwsIoT/Qt5/" -lAwsIoT

LIBS += -L"/usr/local/lib/QtMqtt/Qt5/" -lMqtt

And my source:

include

include

include

include

include

include

include

int main(int argc, char *argv[]) { QCoreApplication a(argc, argv);

qRegisterMetaType<QMqttProtocol::State>("QMqttProtocol::State");

return a.exec();

}

Errors: /usr/local/lib/QtMqtt/Qt5/libMqtt.a(qmqttclient.cpp.o):-1: In function `QMqttClientPrivate::QMqttClientPrivate(QString const&, QMqttClient*)':

/home/nurhak/Desktop/qt_aws/QtMqtt-1.0.0/src/qmqttclient.cpp:134: error: undefined reference to `QWebSocket::QWebSocket(QString const&, QWebSocketProtocol::Version, QObject*)'

/usr/local/lib/QtMqtt/Qt5/libMqtt.a(qmqttclient.cpp.o):-1: In function `QMqttClientPrivate::connect(QMqttNetworkRequest const&, QMqttWill const&)':

/home/nurhak/Desktop/qt_aws/QtMqtt-1.0.0/src/qmqttclient.cpp:163: error: undefined reference to `QNetworkRequest::url() const'

.. etc