Forum: GNU Radio Make Errors with Out of Tree Block

Afbb56f25f6c6a2d88882cd10606d791?d=identicon&s=25 Jonathan Fox (Guest)
on 2014-05-10 00:35
(Received via mailing list)
Attachment: energy_detector_sink_f_impl.cc (6 KB)
I have an energy detector block and I am trying to gr_message with it:

    void energy_detector_sink_f_impl::send_to_message_q(float *buffer,
int
buffersz) {
        gr_message_sprt msg = gr_make_message(0, sizeof(float),
buffersz,
sizeof(float)*buffersz);
        memcpy(msg->msg(), buffer, sizeof(float) * buffersz);
        d_msgq->insert_tail(msg);
    }

and I get this error when I run the "make" command

/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_q(float*,
int)’:
/home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:134:
error: ‘gr_message_sprt’ was not declared in this scope
/home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:134:
error: expected ‘;’ before ‘msg’
/home/fox/git_repos/custom_modules/gr-specsense/lib/energy_detector_sink_f_impl.cc:135:
error: ‘msg’ was not declared in this scope
make[2]: ***
[lib/CMakeFiles/gnuradio-specsense.dir/energy_detector_sink_f_impl.cc.o]
Error 1
make[1]: *** [lib/CMakeFiles/gnuradio-specsense.dir/all] Error 2

What am I doing wrong here? I thought msg is getting declared with
gr_message_sptr msg =

Thanks

Jon

PS I attached the C++ code to be through.
B4ffbc711addde4c649b1ed526df6157?d=identicon&s=25 Martin Braun (Guest)
on 2014-05-10 14:51
(Received via mailing list)
On 05/10/2014 12:34 AM, Jonathan Fox wrote:
> and I get this error when I run the "make" command
> make[2]: ***
> [lib/CMakeFiles/gnuradio-specsense.dir/energy_detector_sink_f_impl.cc.o]
> Error 1
> make[1]: *** [lib/CMakeFiles/gnuradio-specsense.dir/all] Error 2
>
> What am I doing wrong here? I thought msg is getting declared with
> gr_message_sptr msg =

Maybe a sign to move away from message queues? :D

In any case, you have a typo in the code. Fix it and your errors should
go away.

M
Afbb56f25f6c6a2d88882cd10606d791?d=identicon&s=25 Jonathan Fox (Guest)
on 2014-05-12 17:26
(Received via mailing list)
Share pointer abbreviation: S-P-T-R not S-P-R-T.

Thanks for the pointer about typos Martin.
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.