Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. MQTT - Mosquitto : C++, Qt 5.8, Windows 7. I need your help ;)
QtWS25 Last Chance

MQTT - Mosquitto : C++, Qt 5.8, Windows 7. I need your help ;)

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 3 Posters 3.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Maelios
    wrote on last edited by Maelios
    #1

    Hi everyone,
    Since few days, I'm trying to develop my c++ client for windows (for subscribe and publish) without success...
    So, I have tried to build and run examples found on GitHub, ... but again with no success.

    For my project, I used headers & libraries from devel to mosquitto-1.4.12 and sample main.cpp that "implements" mosquittopp.h but i never succeed to run my program without instant crash.

    Please help me, What files i forgot? What am I doing wrong? Have you got a working sample client for Qt and compil on Windows ? :)

    i use Qt 5.8.0 MSVC 2015 x86 for build and run (but i can dowgrade if it's necessary)

    Thanks so much for your answers!

    Regards,
    Maelios

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      If your dependencies relie on .dll files, the you need to modify your Run environment PATH variable and add the path(s) containing these .dlls.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      M 1 Reply Last reply
      3
      • mrjjM Offline
        mrjjM Offline
        mrjj
        Lifetime Qt Champion
        wrote on last edited by mrjj
        #3

        Hi
        What version is the devel dlls compiled with ( vs2013,2015 ?)
        I can see the one for normal download is vs2013
        mosquitto-1.4.12-install-win32.exe (~200 kB) (Native build, Windows Vista and up, built with Visual Studio Community 2013)
        and you have 2015. So please check its same visual studio.

        Also did you try the test cmdline programs?

        to subscribe to a topic:

        mosquitto_sub -t 'test/topic' -v

        And to publish a message:

        mosquitto_pub -t 'test/topic' -m 'hello world'

        To test your installation is working.

        as @SGaist says, if you did not install the normal packet, you might not have the
        dlls in the right place/ to be found,

        Running the cmdline tools should cast some light on that.

        1 Reply Last reply
        3
        • M Offline
          M Offline
          Maelios
          wrote on last edited by Maelios
          #4

          hello guys,
          thank you so much for yours answers!

          Today I achieved to run my program and to publish a message to the broker

          • I have add my directory (with all mosquitto dlls) into the PATH
          • i check the cmdlines and run it with success
          • MSVC 2013 or 2015 works
          • for the installation of mosquitto, i used the latest .exe on mosquitto.org

          -> And in my .pro i made the links with the mosquitto libs
          i share my .pro (if that can help other people)
          [
          QT += core network
          QT -= gui

          CONFIG += c++11

          TARGET = MqttTest
          CONFIG += console
          CONFIG -= app_bundle

          TEMPLATE = app

          SOURCES +=
          main.cpp

          HEADERS +=
          mosquitto.h
          mosquittopp.h

          LIBS += -L"$$PRO_FILE_PWD/libs/" -lmosquittopp
          LIBS += -L"$$PRO_FILE_PWD/libs/" -lmosquitto
          ]

          1 Reply Last reply
          2
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Where are you modifying PATH ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1
            • SGaistS SGaist

              Hi and welcome to devnet,

              If your dependencies relie on .dll files, the you need to modify your Run environment PATH variable and add the path(s) containing these .dlls.

              Hope it helps

              M Offline
              M Offline
              Maelios
              wrote on last edited by
              #6

              @SGaist said in MQTT - Mosquitto : C++, Qt 5.8, Windows 7. I need your help ;):

              Run environment PATH variable and add the path(s) containing these .dlls.

              here :)

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved