I am trying to make an out of tree module by following the tutorial on
Gnu
radio website. I can write simple blocks in C++, compile it and install
it
to it usable in Gnuradio company.
But for some complex block, I want to implement them based on the
gnuradio
build-in blocks, for example, clock_recovery_mm_ff. So I make a new
block
in my out-of-tree module and try to first “copy” the build-in block into
my
out-of-tree module.
I changed the following 4 files in my OOT module to match the
corresponding
files of the build-in block:
The source files are added to the CMakeLists.text files. But they are
not
added by my self, they are added when I use “gr_modtool add -t general
my_block” and “gr_modtool makexml my_block” to make a new block and xml
file.
Only the my_block.h file in include directory contains API
class MY_MODULE_API my_block : virtual public gr::block
{
…
}
Could you please tell me how to check the API property for the block?
Thanks in advance.
I checked all the 4 files. I changed the original module and block names
of
build-in block into my module and block names. But unfortunately, the
error
still exists.
Could it be possibly because the build-in block, in my case
“clock_recovery_mm_ff” block, has some special dependency which is
included
in the code of the module but not in the code of the block.
The type of “clock_recovery_mm_ff” block is abnormal. It is just block,
not
gr::block nor gr::sync_block as mentioned in the OOT tutorial . Here is
the
code of declaration of this block in *.h file in “include” folder.
class DIGITAL_API clock_recovery_mm_ff : virtual public block
In my code, I change it into
class MY_MODULE_API my_block : virtual public block
I’ve had a similar problem when I generated files for my own module
using the gr_modtool and then copied some existing code by replacing the
file(s) that gr_modtool generates. It turns out I had overlooked that
the new “my_block” name needs to be changed in several places, like the
namespace declaration, the #include compiler directive, and the
conditional #ifndef INCLUDED … directives. Once I updated that
correctly the AttributeError got resolved.