0
namespace gr {
   namespace zeromq {

    class base_impl : public virtual gr::sync_block
    {
    public:
      base_impl(int type, size_t itemsize, size_t vlen, int timeout, bool pass_tags);
      virtual ~base_impl();
      
    protected:
      zmq::context_t  *d_context;
      zmq::socket_t   *d_socket;
      size_t          d_vsize;
      int             d_timeout ;
      bool            d_pass_tags ;
    };

    class base_sink_impl : public base_impl
    {
    public:
      base_sink_impl(int type, size_t itemsize, size_t vlen, char *address, int timeout, bool pass_tags, int hwm);

    protected:
      int send_message(const void *in_buf, const int in_nitems, const uint64_t in_offset);
    };
} // namespace zeromq
}

`main(){

gr::zeromq::base_sink_impl *d_zeromq;

d_zeromq = new gr::zeromq::base_sink_impl(ZMQ_PUSH, sizeof(float), 1, "tcp://127.0.0.1:9098", 100, false, -1);

return 0;
}`

Hello! After run this code, I have this error:

error: invalid new-expression of abstract class type ‘gr::zeromq::base_sink_impl’ _sink_impl(ZMQ_PUSH, sizeof(float), 1, "tcp://127.0.0.1:9098", 100, false, -1);

                                                                          ^

I'm not sure how to solve this error. I think I'm making wrong the constructor.... Please, any help will really appreciate it. Thanks

1 Answers1

0

I find the error: the super class gr::sync_block has a virtual method called work. I declared int work(int, gr_vector_const_void_star&, gr_vector_void_star&); inside the class base_impl and compiled.

Unfortunately, I can't run the project as It seems I have to configurate one of the CMakeList.txt to recognize zmq.hpp. It also seems I have to configurate the CMakeList.txt in my swig directory as I'm trying to do a GNURadio OOT Block using ZeroMQ.

Any help with it , I really Appreciate it.

Pd: If I resolve it, I 'll post it here: GNU Radio OOT block : AttributeError: 'module' object has no attribute 'pthread' (using ZeroMQ sockets)