Forum: GNU Radio message passing error

2d0f6bc46e0515bc4d82688718650b25?d=identicon&s=25 MHMND Herath (Guest)
on 2014-01-25 15:23
(Received via mailing list)
Dear Sir
When I trying to implement message passing between 2 blocks called a1_ff
and
a2_ff following error comes when comiling. I cannot trace it.
Thanks
Neil
-----------------------------------------
Scanning dependencies of target gnuradio-avg
[  5%] Building CXX object
lib/CMakeFiles/gnuradio-avg.dir/a1_ff_impl.cc.o
In file included from /usr/include/boost/bind.hpp:22:0,
                 from /usr/include/boost/thread/detail/thread.hpp:29,
                 from /usr/include/boost/thread/thread.hpp:22,
                 from /usr/local/include/gnuradio/thread/thread.h:26,
                 from /usr/local/include/gnuradio/basic_block.h:31,
                 from /usr/local/include/gnuradio/block.h:27,
                 from /usr/local/include/gnuradio/sync_block.h:27,
                 from /home/neil/gr-avg/include/avg/a1_ff.h:26,
                 from /home/neil/gr-avg/lib/a1_ff_impl.h:23,
                 from /home/neil/gr-avg/lib/a1_ff_impl.cc:26:
/usr/include/boost/bind/bind.hpp: In instantiation of struct
boost::_bi::result_traits<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)()>:
/usr/include/boost/bind/bind_template.hpp:15:48:   required from class
boost::_bi::bind_t<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >
/home/neil/gr-avg/lib/a1_ff_impl.cc:49:43:   required from here
/usr/include/boost/bind/bind.hpp:69:37: error: void
(gr::avg::a1_ff_impl::*)() is not a class, struct, or union type
     typedef typename F::result_type type;
                                     ^
In file included from
/usr/include/boost/function/detail/maybe_include.hpp:18:0,
                 from
/usr/include/boost/function/detail/function_iterate.hpp:14,
                 from
/usr/include/boost/preprocessor/iteration/detail/iter/forward1.hpp:52,
                 from /usr/include/boost/function.hpp:64,
                 from /usr/local/include/gnuradio/basic_block.h:33,
                 from /usr/local/include/gnuradio/block.h:27,
                 from /usr/local/include/gnuradio/sync_block.h:27,
                 from /home/neil/gr-avg/include/avg/a1_ff.h:26,
                 from /home/neil/gr-avg/lib/a1_ff_impl.h:23,
                 from /home/neil/gr-avg/lib/a1_ff_impl.cc:26:
/usr/include/boost/function/function_template.hpp: In instantiation of
static
void boost::detail::function::void_function_obj_invoker1<FunctionObj, R,
T0>::invoke(boost::detail::function::function_buffer&, T0) [with
FunctionObj =
boost::_bi::bind_t<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >;
R = void; T0 = boost::intrusive_ptr<pmt::pmt_base>]:
/usr/include/boost/function/function_template.hpp:934:38:   required
from
void boost::function1<R, T1>::assign_to(Functor) [with Functor =
boost::_bi::bind_t<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >;
R = void; T0 = boost::intrusive_ptr<pmt::pmt_base>]
/usr/include/boost/function/function_template.hpp:722:7:   required from
boost::function1<R, T1>::function1(Functor, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type) [with Functor = boost::_bi::bind_t<boost::_bi::unspecified,
void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >;
R = void; T0 = boost::intrusive_ptr<pmt::pmt_base>; typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type = int]
/usr/include/boost/function/function_template.hpp:1069:16:   required
from
boost::function<R(T0)>::function(Functor, typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type) [with Functor = boost::_bi::bind_t<boost::_bi::unspecified,
void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >;
R = void; T0 = boost::intrusive_ptr<pmt::pmt_base>; typename
boost::enable_if_c<boost::type_traits::ice_not<boost::is_integral<Functor>::value>::value,
int>::type = int]
/usr/local/include/gnuradio/basic_block.h:344:34:   required from void
gr::basic_block::set_msg_handler(pmt::pmt_t, T) [with T =
boost::_bi::bind_t<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >;
pmt::pmt_t = boost::intrusive_ptr<pmt::pmt_base>]
/home/neil/gr-avg/lib/a1_ff_impl.cc:49:44:   required from here
/usr/include/boost/function/function_template.hpp:153:11: error: no
match for
call to (boost::_bi::bind_t<boost::_bi::unspecified, void
(gr::avg::a1_ff_impl::*)(),
boost::_bi::list2<boost::_bi::value<gr::avg::a1_ff_impl*>, boost::arg<1>
> >)
(boost::intrusive_ptr<pmt::pmt_base>&)
           BOOST_FUNCTION_RETURN((*f)(BOOST_FUNCTION_ARGS));
           ^
make[2]: *** [lib/CMakeFiles/gnuradio-avg.dir/a1_ff_impl.cc.o] Error 1
make[1]: *** [lib/CMakeFiles/gnuradio-avg.dir/all] Error 2
make: *** [all] Error 2
neil@neil-pc:~/gr-avg/build$
5ae0bf78eda9687cb0852343b3379850?d=identicon&s=25 Johan Carlsson (Guest)
on 2014-01-25 15:42
(Received via mailing list)
Looks like a a C++ or boost question?

Are you experienced in using C++ templates?

Regards,
Johan
5ae0bf78eda9687cb0852343b3379850?d=identicon&s=25 Johan Carlsson (Guest)
on 2014-01-26 13:20
(Received via mailing list)
Looks like there's something wrong with how you try to instantiate a
struct from a trait. Possibly wrong template parameters?

The problem has nothing to do with GNU Radio per se.

You should check the boost documentation or some C++ resource, e.g.
http://www.parashift.com/c++-faq/index.html

HTH, Johan
This topic is locked and can not be replied to.