Making and Installing a New Block

OK I did some more trouble shooting to narrow down the problem. I
decided to start with C++ code from a block that I knew already
worked.

I extracted the file gr-howto-write-a-block-3.0.4.tar.gz. I then
installed the block using the normal configure, make, and make
install procedure. I then created a python program called
squaredaudio.py to test the howto_square2_ff block. It worked
correctly. I’ve attached this file.

Then I created new c++ source files in the topdir/src/lib/
directory. They were howto_square3_ff.cc and howto_square3_ff.h.
The goal here was to create a copy of the howto_square2_ff block
only under another name. I copied the source files for the square
2 block into the source files for the square 3 block. I changed
the names from square2 to square3. I modified the howto.i with
the additional lines of codes for the new block. I based these off
of what was already in the file for square_ff and square2_ff.

Next I modifed the file topdir/src/lib/makefile.am. I added the
file names howto_square3_ff.cc and howto_square3_ff.h next to the
places where the file names for the other blocks were.

All other files were left as they came in the tar.gz file. When
the block is installed I don’t get an error. However when I run my
test program I get an error which I’ve included in error.txt.

The main part seems to be:
/usr/local/lib/python2.5/site-packages/gnuradio/_howto.so: undefined
symbol: _Z21howto_make_square3_ffv

This error is the same whether I try to use the howto_square2_ff or
howto_square3_ff block in squaredaudio.py.

I get the feeling I’m supposed to modify some other files but I can’t
figure out what to change. Any ideas?

Thanks,
Keith

On Thu, Oct 04, 2007 at 10:24:51AM -0500, Franklin Sands wrote:

Then I created new c++ source files in the topdir/src/lib/
places where the file names for the other blocks were.

All other files were left as they came in the tar.gz file. When
the block is installed I don’t get an error. However when I run my
test program I get an error which I’ve included in error.txt.

The main part seems to be:

/usr/local/lib/python2.5/site-packages/gnuradio/_howto.so: undefined
symbol: _Z21howto_make_square3_ffv

This error is the same whether I try to use the howto_square2_ff or
howto_square3_ff block in squaredaudio.py.

I get the feeling I’m supposed to modify some other files but I can’t figure out what to change. Any ideas?

Thanks,
Keith

What directory are you in when you try to run your program?
Be sure to NOT be in the directory containing the code. This avoid
potential problems with how python resolves imported files.

Have your done a “make install”? Note that the error message above
indicates that it’s looking in the installed path. If you haven’t
installed the code yet with “make install” it’ll be pulling in the old
libs.

Let me know if this helps.

Eric