Make Errors with Out of Tree Block

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.

On 05/10/2014 12:34 AM, Jonathan F. 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? :smiley:

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

M

Share pointer abbreviation: S-P-T-R not S-P-R-T.

Thanks for the pointer about typos Martin.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs