Solved how to add library(qmqtt.h) in qmqtt client for windows
-
@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
-
thank you,
i will try building the qmqtt. -
@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 -
@shravani Can you explain what exactly you did?
-
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? -
@jsulm
i used qt creator.i just opened .pro file (src/mqtt/mqtt.pro from above link)using qtcreator and build all. -
@shravani Can you post the build log?
-
@jsulm
when i click on build all one dialog box came like below.but in build folder(build-abc-Desktop_Qt_5_8_1_MinGW_32bit-Debug) .lib file not generated only 3 folders(.moc, .obj , .pch) created .!! -
@shravani It looks like you're clicking on Run not on Build. Since mqtt is a lib you cannot execute it. And again: can you post the build log?
-
@jsulm
sorry ,i can only post what i got after building in build folder.!
-
@shravani Why can't you post the build log? You have it in QtCreator. The screen-shots you posted do not help.
-
@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? -
@shravani
Getting started.
Probably you should consider buying a book about Qt also -
@raven-worx
but using qtcreator also, run qmake is possible right?why am i not getting .lib file file?can you see screenshots of my debug folder (above)after building. -
@shravani
yes, but especially when you are not completley sure what you are doing there are some pitfalls.
You can try to build using QtCreator, but then do not press the Run/Debug button, but the Build button below. -
@raven-worx
hi,
after building i came to know qmqtt.lib was created(5th line from last).but i could not find it inorder to add that path to .pro file.can u please tell by default where it will be stored? in build/debug also it is not present(see above post).thank you