Tests do not compile
Closed this issue · 1 comments
I followed the getting started guide, and then tried compiling the tests, but this failed with lots of the following errors:
g++ -c -pipe -O2 -Wall -Wextra -D_REENTRANT -fPIC -DSRCDIR=\"/home/simon/nzmqt/src/\" -DQT_NO_DEBUG -DQT_TESTLIB_LIB -DQT_CORE_LIB -DQT_TESTCASE_BUILDDIR='"/home/simon/nzmqt/src"' -I. -I../include -I../externals/include -I/include -I/opt/local/include -I/opt/Qt/5.15.2/gcc_64/include -I/opt/Qt/5.15.2/gcc_64/include/QtTest -I/opt/Qt/5.15.2/gcc_64/include/QtCore -I. -I/opt/Qt/5.15.2/gcc_64/mkspecs/linux-g++ -o nzmqt_test.o test/nzmqt_test.cpp In file included from ../include/nzmqt/nzmqt.hpp:32, from ./common/SampleBase.hpp:30, from ./pubsub/Publisher.hpp:30, from test/nzmqt_test.cpp:27: ../externals/include/zmq.hpp:550:47: error: ‘zmq_event_t’ does not name a type 550 | virtual void on_event_connected(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } | ^~~~~~~~~~~ ../externals/include/zmq.hpp:551:53: error: ‘zmq_event_t’ does not name a type 551 | virtual void on_event_connect_delayed(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } | ^~~~~~~~~~~ ../externals/include/zmq.hpp:552:53: error: ‘zmq_event_t’ does not name a type 552 | virtual void on_event_connect_retried(const zmq_event_t &event_, const char* addr_) { (void)event_; (void)addr_; } | ^~~~~~~~~~~
Maybe there is a step missing from the guide?
I performed the following steps:
- Install Qt version 5.15.2
- Install ZeroMQ: sudo apt install libzmq3-dev
- Get nzmqt: git clone https://github.com/jonnydee/nzmqt.git
- cd nzmqt
- git checkout version-3.2.0
- ./setup-project.sh
- cd src
- qmake nzmqt_test.pro
- make
My setup:
Ubuntu 21.10
gcc version 11.2.0
make version 4.3
I have now managed to get the tests to build and run.
The solution was to clone the libzmq git repository (https://github.com/zeromq/libzmq) and follow the instructions in the INSTALL file to make, build and install from the sources.