discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] Problem with undefined symbol in new block create


From: Martin Braun
Subject: Re: [Discuss-gnuradio] Problem with undefined symbol in new block created by gr_modtool in 3.7.2
Date: Thu, 06 Mar 2014 10:55:22 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0

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



reply via email to

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