zeromq / cppzmq

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

i could not use the zmq_addon.hpp in my project #551

Closed adadKKKX closed 2 years ago

adadKKKX commented 2 years ago

i used cppzmq in my project and i want use the zmq::multipart_t

wget -c https://github.com/zeromq/cppzmq/raw/master/zmq_addon.hpp
(in /usr/include)

but

❗ error: /usr/include/zmq_addon.hpp:46:1: error: ‘recv_result_t’ does not name a type recv_result_t ^~~~~ /usr/include/zmq_addon.hpp: In function ‘void zmq::detail::write_network_order(unsigned char, uint32_t)’: /usr/include/zmq_addon.hpp:80:9: error: ‘ZMQ_CONSTEXPR_VAR’ was not declared in this scope ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits::max(); ^~~~~ /usr/include/zmq_addon.hpp:80:9: note: suggested alternative: ‘ZMQ_ROUTER_RAW’ ZMQ_CONSTEXPR_VAR uint32_t mask = std::numeric_limits::max(); ^~~~~ ZMQ_ROUTER_RAW /usr/include/zmq_addon.hpp:81:61: error: ‘mask’ was not declared in this scope buf++ = static_cast((value >> 24) & mask); ^~~~ /usr/include/zmq_addon.hpp: At global scope: /usr/include/zmq_addon.hpp:118:1: error: ‘ZMQ_NODISCARD’ does not name a type; did you mean ‘ZMQ_NOBLOCK’? ZMQ_NODISCARD recv_result_t recv_multipart(socket_ref s,

in src/libsrc/ABU2022Com.cc

adadKKKX commented 2 years ago

include thus


#include <zmq.hpp>
#include <zmq_addon.hpp>

it is avaliable in win10(VS) but not support in linux(ubuntu 18 ) 64bit

gummif commented 2 years ago

You need both headers to be from the same version of cppzmq. It looks like there is some mismatch.

adadKKKX commented 2 years ago

You need both headers to be from the same version of cppzmq. It looks like there is some mismatch.

it means Linux can't use zmq_addon.hpp ? ops. i just want use multipart , i found the zmq::multipart_t in zmq_addon(my win 10) so is there any method to use multipart_t in linux?