Closed Flatfish99 closed 4 years ago
Did you set the standard to at least C++11?
Did you set the standard to at least C++11?
I'm a beginer and I'm sorry for the low-level question.I have fixed it .thank you for your help .
@gummif, @Flatfish99 So was the solution simply to use C++11 or later?
I am asking, because I am experiencing the same issue, although I am using C++11
error: no member named 'send_flags' in namespace 'zmq'
error: no member named 'buffer' in namespace 'zmq'
You can check the macros in the zmq.hpp header if they are defined. Are you using an old compiler?
It was actually a version conflict. Had the wrong libzmq.
include
int main() { zmq::context_t ctx; zmq::socket_t sock(ctx, zmq::socket_type::push); sock.bind("inproc://test"); sock.send(zmq::str_buffer("Hello, world"), zmq::send_flags::dontwait); }
when i try to complie this
Scanning dependencies of target demo [ 50%] Building CXX object CMakeFiles/demo.dir/main.cpp.o [100%] Linking CXX executable demo [100%] Built target demo (base) localhost:build landkyani$ make Scanning dependencies of target demo [ 50%] Building CXX object CMakeFiles/demo.dir/main.cpp.o /Users/landkyani/github/cppzmq-master/demo/main.cpp:6:34: error: no member named 'socket_type' in namespace 'zmq'; did you mean 'socket_t'? zmq::socket_t sock(ctx, zmq::socket_type::push);