Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. how to add compiler option for a library
QtWS25 Last Chance

how to add compiler option for a library

Scheduled Pinned Locked Moved Solved 3rd Party Software
compiler optionlibrarymqttc++qt6
3 Posts 2 Posters 760 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.
  • D Offline
    D Offline
    Dean21
    wrote on last edited by
    #1

    Hi everyone so I am trying to use the mosquitto mqtt open source library with my qt c++ widget application. But I am having trouble getting qt creator to compile I have tried adding QMAKE_CXXFLAGS += -lmosquitto
    But it doesn't work as I still get lots of errors saying undefined reference to 'function name here'

    Does anyone know how to add third party library compiler options?

    FYI: I am on ubuntu, creating a widget application and am using qmake

    Any help with this would be greatly appreciated,
    Thanks in advance,
    Dean

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

      Hi and welcome to devnet,

      LIBS += -lmosquito
      

      Should do the trick if mosquito is installed in a standard location.

      On a side note, Qt has its own mqtt module that is cross-platform as well.

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

      D 1 Reply Last reply
      1
      • SGaistS SGaist

        Hi and welcome to devnet,

        LIBS += -lmosquito
        

        Should do the trick if mosquito is installed in a standard location.

        On a side note, Qt has its own mqtt module that is cross-platform as well.

        D Offline
        D Offline
        Dean21
        wrote on last edited by
        #3

        @SGaist Great Thank you this, I know that qt has its own MQTT module just I had already developed my code for MQTT using the mosquitto library before I knew I was going to be making a GUI using QT.

        1 Reply Last reply
        0

        • Login

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