[zeromq-dev] How to use ZeroMQ context with zauth?

Check Peck comptechgeeky at gmail.com
Mon Dec 15 23:28:29 CET 2014

I need to use ZeroMQ context from C++ binding to C way of ZeroMQ context so
when I do it like this, I get a Segmentation fault

    zctx_t* ctx_ptr = static_cast<zctx_t*>((void*)context);
    m_auth = zauth_new (ctx_ptr);

I am using Strawhouse security pattern by following this link -

On Mon, Dec 15, 2014 at 1:20 PM, Check Peck <comptechgeeky at gmail.com> wrote:
> I am using C++ bindings for ZeroMQ and I have declared context as -
>     zmq::context_t&     context
>     zauth_t             *m_auth;
> Now I am trying to use Strawhouse security pattern in my application and
> for which I need to czmq which is a C binding not C++ binding.
> Now when I try to initialize zauth like below, it always fail during
> compilation and I am not sure what's wrong?
>     m_auth = zauth_new (*context);
> Below is the compilation error -
> In file included from
> /usr/local/include/boost/detail/container_fwd.hpp:98:0,
>                  from
> /usr/local/include/boost/functional/hash/extensions.hpp:17,
>                  from
> /usr/local/include/boost/functional/hash/hash.hpp:529,
>                  from /usr/local/include/boost/functional/hash.hpp:6,
>                  from /usr/local/include/boost/regex/v4/basic_regex.hpp:23,
>                  from /usr/local/include/boost/regex/v4/regex.hpp:67,
>                  from /usr/local/include/boost/regex.hpp:31,
>                  from /home/david/ZeroMQTester/test_queue.cpp:7:
> /usr/include/c++/4.7/complex:379:5: note: template<class _Tp>
> std::complex<_Tp> std::operator*(const std::complex<_Tp>&, const
> std::complex<_Tp>&)
> /usr/include/c++/4.7/complex:379:5: note:   template argument
> deduction/substitution failed:
> /home/david/ZeroMQTester/test_queue.cpp:126:26: note:   âzmq::context_tâ
> is not derived from âconst std::complex<_Tp>â
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.zeromq.org/pipermail/zeromq-dev/attachments/20141215/9cf2393d/attachment.htm>

More information about the zeromq-dev mailing list