Using Zeromq with Qt



  • 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 ?



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



  • @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"
    


  • Please check your 0MQ version installed in your machine.



  • @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



  • 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.



  • @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.



  • @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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.