discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Hierarchical Block in c++ not working, linker or swig


From: Julius Durst
Subject: [Discuss-gnuradio] Hierarchical Block in c++ not working, linker or swig problem
Date: Tue, 28 Oct 2014 19:51:42 +0100

Hi list.

I am trying to write a hierarchical block in c++ in an OOT module.
I create the block with the gr_modtool and try to make a very simple hier block. The only relevant changes to the template are:

in the ...impl.cc:

#include <gnuradio/blocks/copy.h>
...
testhier::make()... unchanged
...
gr::blocks::copy::sptr copy(gr::blocks::copy::make(sizeof(gr_complex)));
connect(self(), 0, copy, 0);
connect(copy, 0, self(), 0);

testhier_impl::testhier_impl()
  : gr::hier_block2("testhier",
      gr::io_signature::make(1, 1, sizeof(gr_complex)),
      gr::io_signature::make(1, 1, sizeof(gr_complex)))
  {
gr::blocks::copy::sptr copy(gr::blocks::copy::make(sizeof(gr_complex)));
    connect(self(), 0, copy, 0);
    connect(copy, 0, self(), 0);
  }

So this should be the quite simplest form of a hier block. However, the following wierdnesses occur:

On Ubuntu:
make is successful
If I import the module in python, I get a segmentation fault. As far as I got with gdb, the error may be somewhere in swig. However, if I first do "from gnuradio import blocks", the import is successful, but the module only contains the python blocks, all c++ blocks are missing. When I only use a block from the same OOT module in the hier block, the import also is successful, but again the c++ blocks are missing.

On arch linux:
make fails with a linker error:
undefined reference to `gr::blocks::copy::make(unsigned long)'
However if I only use a block from the same OOT module in the hier block, the whole thing seems to work.


What am I doing wrong? Did I forget to include something? Can it be that hard to make a c++ hier block?

Thanks for your help

Julius



reply via email to

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