# Problem with undefined symbol in new block created by gr\_modtool in 3.7.2

**URL:** <https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587>\
**Category:** GNU Radio\
**Created:** [March 5, 2014, 8:59pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587 "2014-03-05T20:59:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [March 5, 2014, 8:59pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/1 "2014-03-05T20:59:04Z")

</div>

Hello all,

I am dealing with the problem of undefined symbol when trying to execute  
a  
python script for testing my new custom block created in GNU Radio  
3.7.2.  
I used gr\_modtool for creating the new block and also followed the  
instructions posted at

[http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig](http://gnuradio.org/redmine/projects/gnuradio/wiki/OutOfTreeModulesConfig)

for correctly configuring it but the problem still holds.

Any ideas?

Thanks,  
-George

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 5, 2014, 9:23pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/2 "2014-03-05T21:23:01Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA256

Hi George,  
This is a little unspecific. Most probably you have a problem similar to  
the fftw- related problem of activecat, but that’s only guessing…  
Please heed  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/ReportingErrors](http://gnuradio.org/redmine/projects/gnuradio/wiki/ReportingErrors) when  
reporting errors.  
Greetings,  
Marcus

On March 5, 2014 8:57:46 PM CET, George S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> * * *
> 
> * * *
> 
> Discuss-gnuradio mailing list  
> [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

* * *

Sent from my Android device with K-9 Mail. Please excuse my brevity.  
-----BEGIN PGP SIGNATURE-----  
Version: APG v1.0.9

iQFABAEBCAAqBQJTF4c7IxxNYXJjdXMgTfxsbGVyIDxtYXJjdXNAaG9zdGFsaWEu  
ZGU+AAoJEBKNLRrpJvfojQoH/2a609iWLTsywtozQ+FcZkuQT6uCy13vX3n4b5k3  
rTvy9QP3uHuHQkiRZHDbZoJ+mZ9kFOf6NeG20RGdf8i4yCB1AZ8F7uvvdi7CebXT  
sRQxoQE+8Vz5VS+faAStAOK3+tArdRGZOU2v3gTYXGCvATaeM3A+rxsNQ7LKPwM8  
sI5KZ3xgvgikkObbFuo00MOaLA7tHzMttXxWjU5riXann1l1eOyGIzM1j0XO1gAD  
imofs0DfXHB4cE0Gi43E1gjjeqEW034dLZAS7w/c/Gq85Z0Ni+z1a35kS5UYvYhQ  
ndeEMqrLQv4ghCRnHR93ob+8YRlqMedVjDDeKQdjEh0D2jY=  
=27ny  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 5, 2014, 9:24pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/3 "2014-03-05T21:24:13Z")

</div>

What is the “undefined symbol”? This could be something not linked  
properly inside the CMake files.

Michael

On Wed, Mar 5, 2014 at 11:57 AM, George S. \<

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 5, 2014, 10:46pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/4 "2014-03-05T22:46:13Z")

</div>

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.

Sean

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 5, 2014, 11:03pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/5 "2014-03-05T23:03:34Z")

</div>

Thanks everyone.  
In order to be more specific regarding the future readers of this post,  
I am using Ubuntu 12.04 and GNU Radio v3.7.2.  
I am using the embedded gr\_modtool in order to create a custom signal  
processing block from scratch.  
My block does not use FFT.  
Finally, the problem was solved by just ignoring the implementation  
header file and only include the public header file in the  
/include/nameofBlock .

## Thanks, -George

George S.

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 5, 2014, 10:51pm UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/6 "2014-03-05T22:51:36Z")

</div>

Ah, nevermind about the wiki edit. The use of pure virtual functions is  
already discussed in  
[http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide](http://gnuradio.org/redmine/projects/gnuradio/wiki/BlocksCodingGuide) .  
Still, the gr\_modtool addition may be useful.

---

<div class="post-metadata">

**Author:** ![glsmyth](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/a9adbd/32.png) [@glsmyth](https://www.ruby-forum.com/u/glsmyth)\
**Post date:** [March 6, 2014, 10:56am UTC](https://www.ruby-forum.com/t/problem-with-undefined-symbol-in-new-block-created-by-gr-modtool-in-3-7-2/239587/7 "2014-03-06T10:56:54Z")

</div>

On 05.03.2014 22:44, Nowlan, Sean wrote:

> 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
