Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example doesn't compile (MacOS) #628

Open
JC3 opened this issue Feb 12, 2024 · 0 comments
Open

Example doesn't compile (MacOS) #628

JC3 opened this issue Feb 12, 2024 · 0 comments

Comments

@JC3
Copy link

JC3 commented Feb 12, 2024

The example program here:

#include <string>
#include <zmq.hpp>
int main()
{
   zmq::context_t ctx;
   zmq::socket_t sock(ctx, zmq::socket_type::push);
   sock.bind("inproc://test");
   const std::string_view m = "Hello, world";
   sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
}

Doesn't seem to compile, due to multiple errors:

g++ -I/opt/homebrew/Cellar/cppzmq/4.10.0/include -I/opt/homebrew/Cellar/zeromq/4.3.5_1/include testprogram.cpp -L/opt/homebrew/Cellar/zeromq/4.3.5_1/lib -lzmq
testprogram.cpp:6:33: error: no member named 'socket_type' in namespace 'zmq'; did you mean 'socket_t'?
   zmq::socket_t sock(ctx, zmq::socket_type::push);
                           ~~~~~^~~~~~~~~~~
                                socket_t
/opt/homebrew/Cellar/cppzmq/4.10.0/include/zmq.hpp:2181:7: note: 'socket_t' declared here
class socket_t : public detail::socket_base
      ^
testprogram.cpp:6:46: error: no member named 'push' in 'zmq::socket_t'
   zmq::socket_t sock(ctx, zmq::socket_type::push);
                           ~~~~~~~~~~~~~~~~~~^
testprogram.cpp:9:35: error: no member named 'send_flags' in namespace 'zmq'
   sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
                             ~~~~~^
testprogram.cpp:9:19: error: no member named 'buffer' in namespace 'zmq'
   sock.send(zmq::buffer(m), zmq::send_flags::dontwait);
             ~~~~~^
4 errors generated.

Platform details:

Platform: MacOS Ventura
Installed via: homebrew
zmq version: 4.3.5 (latest available)
cppzmq version: 4.10.0 (latest available)

@JC3 JC3 changed the title It doesn't seem to work (MacOS)... Example doesn't compile (MacOS) Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant