how to add library(qmqtt.h) in qmqtt client for windows
-
@shravani
You need to be more specific to be able to help, since this can have many causes.
Maybe you just need to rerun qmake to update the makefiles?
Show the directory structure and your .pro file. -
hi,
this is my .pro file
and my code is inthis( https://github.com/wuming123057/qmqtt-client) link.
the library i added is https://github.com/emqtt/qmqttQT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11
CONFIG+= NO_UNIT_TESTS
TARGET = qmqtt-client
TEMPLATE = app#NOTICE: add DYLD_LIBRARY_PATH to build environment.
INCLUDEPATH += C:\Qt\qmqtt-master\src
LIBS += -LC:\Qt\qmqtt-master\src -lqmqttSOURCES += main.cpp
mainwindow.cpp
connform.cpp
pubform.cpp
subform.cppHEADERS += mainwindow.h
connform.h
pubform.h
subform.h
mqttform.hFORMS += mainwindow.ui
connform.ui
pubform.ui
subform.uiim getting error:
cannot find -lmqtt
returned 1 exit status -
@shravani said in how to add library(qmqtt.h) in qmqtt client for windows:
INCLUDEPATH += C:\Qt\qmqtt-master\src
should point to the sources of qmqtt (specifically where qmqtt.h is placed in)
LIBS += -LC:\Qt\qmqtt-master\src -lqmqtt
Also you need to build qmqtt beforehand. -L should point to the path of the library (.lib) you built
-
@raven-worx
hi,
i tried building the library(i got "could not find executable please specify one" dialog box) there is no .dll or .lib or .so file in build folder.
in build it created 3 folders(.moc,.obj,.pch).could you please tell me how to generate .lib file -
from here https://github.com/emqtt/qmqtt i downloaded zip file.in that src/mqtt mqtt.pro i built using qt.but that library not generating any .lib files.
(as u told i need to build qmqtt beforehand. -L should point to the path of the library (.lib) you built.) -
@shravani What I wanted to know was: how exactly did you build? What steps did you execute?
"built using qt" - what does this mean? Qt does not build anything. Do you mean you used QtCreator or qmake?
Can you also post the build log? -
@shravani
got the folder where you donwloaded qmqtt (where the qmqtt.pro resides) and and execute the following:- qmake
- nmake (for Visual Studio compiler) or mingw32-make (for mingw)
thats it. No QtCreator needed.
Then the .dll and corresponding .lib (MSVC) or .a (mingw32) file will be created in the output folder. -
@raven-worx
thank you,
im new to qt could you please tell me how to execute qmake and mingw32-make in windows? -
@shravani
open a console window and execute "qmake" let it finished and afterwards execute one of the two (the correct one corresponding to your used compiler!) make commands for building.Make sure that the executable can be found by the system (add the paths to the PATH environment variable)
But those a pretty basics. Probably you should go on reading some learning material first before trying to build a software which is based on a 3rd party library. -
@raven-worx
can u give any link to read? and where .lib will be created? in same folder?