discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Discuss-gnuradio] Trouble with PMTs


From: Jonathan Fox
Subject: Re: [Discuss-gnuradio] Trouble with PMTs
Date: Mon, 19 Jan 2015 10:31:51 -0500

Thanks for the help.

The first thing I did was search the compiler error but wasn't successful in finding a well written answer such as yours.

On Mon, Jan 19, 2015 at 2:12 AM, Martin Braun <address@hidden> wrote:
On 01/19/2015 12:28 AM, Jonathan Fox wrote:
> void energy_detector_sink_f_impl::send_to_message_p(float *out, int
> items_consumed) {
>         pmt::pmt_t msg = pmt::cons(
>                               const pmt::pmt_t out,
>                               const pmt::pmt_t sizeof(float)*items_consumed
>                                         );
>         message_port_pub(d_outfreq, msg);
>         }
>
> and the error:
>
> /home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:
> In member function ‘void
> gr::specsense::energy_detector_sink_f_impl::send_to_message_p(float*, int)’:
> /home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:147:
> error: expected primary-_expression_ before ‘const’
> /home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:148:
> error: expected primary-_expression_ before ‘const’

The error code is telling you what you need to know; your C++ is
invalid. You can't declare variables inside the call to cons(). Use the
converter functions to convert 'out' to a PMT (same with the second PMT)
or use the constructor notation and skip the 'const'.

This is unrelated to PMT or even GNU Radio. I'm sure googling for the
gcc error message would have given you at least some response.

Cheers,
M


_______________________________________________
Discuss-gnuradio mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio


reply via email to

[Prev in Thread] Current Thread [Next in Thread]