On 05.03.2014 22:44, Nowlan, Sean wrote:
The first place I'd look is in your_block.h. Did you remember to
declare any public member functions to be pure virtual in that file,
and then declare your (non-virtual) functions in your_block_impl.h?
If you forgot to declare pure virtual functions, i.e., "virtual
return_type your_block(args_list) = 0;" in your_block.h, it will
compile but you will get the undefined symbol at runtime.
This probably a common pitfall and it might be worth making a note in
the wiki for OutOfTreeModules. I'll add that.
Architects of gr_modtool... can you add an autogen comment in *.h
files reminding the user to declare pure virtual functions? I think
users who don't deeply understand OO and particularly its C++ syntax
would benefit from this reminder. I think it's a common paradigm to
use other examples to fill in the "guts" of gr_modtool generated C++
code, but things like this are easy to miss.
Disciples of gr_modtool...
When you create a block w/ modtool, it has zero public methods (except
for make(), which is arguably special, and gets auto-created in the
impl.cc file).
So if I put in a reminder, it will actually remind people before there's
a reason to declare a function, which might confuse people.
Perhaps a more general instruction on how to add public methods would be
good, though.
I'll think about this.
M
_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio