zeromq / cppzmq

Header-only C++ binding for libzmq
http://www.zeromq.org
MIT License
1.94k stars 757 forks source link

compile failed Ubuntu 20.04, gcc 9.3.0 #521

Closed Thanh-Binh closed 2 years ago

Thanh-Binh commented 2 years ago

I try to compile it using cmake, but got errors home/test/cppzmq/zmq.hpp:2432:18: error: ‘ZMQ_EVENT_HANDSHAKE_FAILED’ was not declared in this scope; did you mean ‘ZMQ_EVENT_BIND_FAILED’? 2432 | case ZMQ_EVENT_HANDSHAKE_FAILED: | ^~~~~~ | ZMQ_EVENT_BIND_FAILED /home/test/cppzmq/zmq.hpp:2435:18: error: ‘ZMQ_EVENT_HANDSHAKE_SUCCEED’ was not declared in this scope 2435 | case ZMQ_EVENT_HANDSHAKE_SUCCEED:

Any idea?

gummif commented 2 years ago

What version of libzmq are you using and is ZMQ_BUILD_DRAFT_API defined?

Thanh-Binh commented 2 years ago

@gummif i installed libzmq3-dev 3 hours ago. I believe it is the current stable version. I am very new with zmq and therefore do not know if ZMQ_BUILD_DRAFT_API is defined?

Thanh-Binh commented 2 years ago

I try cmake .. -DENABLE_DRAFTS=ON -DZMQ_BUILD_DRAFT_API=ON but have the same problem

Thanh-Binh commented 2 years ago

@gummif I found the solution by recompiling both libzmq and cppzmq with option -DENABLE_DRAFTS=ON Thanks