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. Using Zeromq with Qt
Forum Updated to NodeBB v4.3 + New Features

Using Zeromq with Qt

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 8.8k Views 1 Watching
  • 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
    doubitchou
    wrote on last edited by
    #1

    hi,

    I want to use Zeromq with Qt so I've used the newest nzmqt implementation. Unfortunately, this ends by :

    In file included from ..\include/nzmqt/nzmqt.hpp:32:0,
                     from ..\src\nzmqt\nzmqt.cpp:28:
    ..\3rdparty\cppzmq/zmq.hpp:566:47: error: 'zmq_event_t' does not name a type
             virtual void on_event_connected(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; }
                                                   ^
    ..\3rdparty\cppzmq/zmq.hpp:567:53: error: 'zmq_event_t' does not name a type
             virtual void on_event_connect_delayed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_;
    
    ....and so on
    

    I've removed the comment from the .pro file:

    DEFINES += \
    # Uncomment this line for nzmqt "Include and Source File" compilation option.
        NZMQT_LIB
    
    SOURCES += \
    # Uncomment this line for nzmqt "Include and Source File" compilation option.
        nzmqt/nzmqt.cpp \
        app/main.cpp
    

    which doesn't change anything
    I've also tried with the official C++ implementation with the same results.

    What is the way to use Zeromq with Qt using mingw ?

    1 Reply Last reply
    0
    • m.sueM Offline
      m.sueM Offline
      m.sue
      wrote on last edited by
      #2

      Hi,
      Please check whether you added the appropriate "INCLUDEPATH += path/to/the/0mq/include/files" to your .pro-file.
      -Michael.

      D 1 Reply Last reply
      0
      • m.sueM m.sue

        Hi,
        Please check whether you added the appropriate "INCLUDEPATH += path/to/the/0mq/include/files" to your .pro-file.
        -Michael.

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

        @m.sue said in Using Zeromq with Qt:

        Hi,
        Please check whether you added the appropriate "INCLUDEPATH += path/to/the/0mq/include/files" to your .pro-file.
        -Michael.

        Hi Michael,
        Indeed I have set the include path :

        QT       += core gui
        
        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
        
        TARGET = Test_zmq
        TEMPLATE = app
        
        INCLUDEPATH += ../../Git_hub/nzmqt/3rdparty/cppzmq
        
        SOURCES += main.cpp\
                mainwindow.cpp
        
        HEADERS  += mainwindow.h \
                    ../../Git_hub/nzmqt/3rdparty/cppzmq/zmq.hpp
        
        FORMS    += mainwindow.ui
        
        DISTFILES += \
            ../../Git_hub/libzmq/builds/mingw32/Makefile.mingw32
        

        and then use the graphical application template with :

        #include "zmq.hpp"
        
        1 Reply Last reply
        0
        • J Offline
          J Offline
          josephdp
          wrote on last edited by
          #4

          Please check your 0MQ version installed in your machine.

          D 1 Reply Last reply
          0
          • J josephdp

            Please check your 0MQ version installed in your machine.

            D Offline
            D Offline
            doubitchou
            wrote on last edited by doubitchou
            #5

            @josephdp said in Using Zeromq with Qt:

            Please check your 0MQ version installed in your machine.

            I'm not sure to understand. I've cloned nzmqt from Github .

            Besides, if you say that I should also add a path to the "C" version of it like

            INCLUDEPATH += ../../Git_hub/nzmqt/3rdparty/cppzmq \
            ../../ZeroMQ 4.0.4/include
            

            This is not working neither

            1 Reply Last reply
            0
            • m.sueM Offline
              m.sueM Offline
              m.sue
              wrote on last edited by
              #6

              Maybe because of the "blank" in the path name "../../ZeroMQ 4.0.4/include". INCLUDEPATH will understand it as two paths: "../../ZeroMQ" and "4.0.4/include".
              -Michael.

              D 1 Reply Last reply
              0
              • m.sueM m.sue

                Maybe because of the "blank" in the path name "../../ZeroMQ 4.0.4/include". INCLUDEPATH will understand it as two paths: "../../ZeroMQ" and "4.0.4/include".
                -Michael.

                D Offline
                D Offline
                doubitchou
                wrote on last edited by
                #7

                @m.sue said in Using Zeromq with Qt:

                Maybe because of the "blank" in the path name "../../ZeroMQ 4.0.4/include". INCLUDEPATH will understand it as two paths: "../../ZeroMQ" and "4.0.4/include".
                -Michael.

                I thought it were about the path indeed, but after renamed it and modified the .pro:

                INCLUDEPATH += ../../Git_hub/nzmqt/3rdparty/cppzmq \
                               ../../ZeroMQ404/include
                

                I have the same zmq type errors.

                D 1 Reply Last reply
                0
                • D doubitchou

                  @m.sue said in Using Zeromq with Qt:

                  Maybe because of the "blank" in the path name "../../ZeroMQ 4.0.4/include". INCLUDEPATH will understand it as two paths: "../../ZeroMQ" and "4.0.4/include".
                  -Michael.

                  I thought it were about the path indeed, but after renamed it and modified the .pro:

                  INCLUDEPATH += ../../Git_hub/nzmqt/3rdparty/cppzmq \
                                 ../../ZeroMQ404/include
                  

                  I have the same zmq type errors.

                  D Offline
                  D Offline
                  doubitchou
                  wrote on last edited by
                  #8

                  @doubitchou

                  I finally found it, there were 2 things:

                  • the space in the path
                  • the order of inclusions : you need to include zeromq before nzmqt

                  Thanks Michael

                  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