emqx / qmqtt

MQTT client for Qt

Home Page:https://www.emqx.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

when i use protrol ws connnect eqmx,build error like this

eclipseorc opened this issue · comments

like this:
C:\QtDemo\aiSark\mqtt.cpp:10: error: undefined reference to `_imp___ZN5QMQTT6ClientC1ERK7QStringS3_N18QWebSocketProtocol7VersionEbP7QObject'

source code:
mqtt_client = new QMQTT::Client("ws://mqtt.unbec.com/iot", "", QWebSocketProtocol::VersionLatest);

commented

It looks like you're compiling your own code with websocket support enabled, but had it disabled when compiling the mqtt library (it's disabled by default).

thank u very much,i complie agin!

thank u again, i'm a new user for qt.
i compilie the mqtt agin like this:
##########################################
TARGET = QtQmqtt
QT = core network websockets
qtHaveModule(websockets): QMQTT_WEBSOCKETS: QT += websockets

DEFINES += QT_NO_CAST_TO_ASCII QT_NO_CAST_FROM_ASCII

CONFIG += QMQTT_NO_SSL

CONFIG += QMQTT_WEBSOCKETS
################################################

this time i append "websockets" behind the "network" and add "CONFIG += QMQTT_WEBSOCKETS"
It can be used normal.

Ok, so we may close this?