zeromq / cppzmq

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

how to `#include <zmq.h>` ? #529

Closed midannii closed 2 years ago

midannii commented 2 years ago

I want to use zmq of cpp version. So I used followed example in your github README.

#include <stdio.h>
#include <string>
#include "zmq.hpp"
int main()
{
   zmq::context_t context;
   zmq::socket_t socket(context, zmq::socket_type::push);
   socket.bind("tcp://*:5555");
   const std::string_view m = socket.recv()
   socket.send(zmq::buffer(m), zmq::send_flags::dontwait);
}

And I also included zmq.hpp. However, in zmq.hpp int line 36, there is #include <zmq.h> and it occurs error like "zmq.hpp file not found". I don't know how to solve it ;(

b3ll9trix commented 2 years ago

Hello @midannii how did you solve this? I ran into the same issue.

gummif commented 2 years ago

The dependency libzmq needs to be installed somewhere the compiler finds it.