OOT module based on file_sink_base generates symbol not found error

Guys,

This may be a beginner question, but here it goes. I have built several
OOT
modules for my own blocks using gr_modtool as indicated in the
Out-of-tree
tutorial w. great success. These blocks were subclasses of gr::blocks.

Now I have created a new block called file_format_sink very similar to
file_sink whose parent class is gr::file_sink_base. It all builds fine
but
when I run a flowgraph with file_format_sink using grc, I get the
following
error:

Traceback (most recent call last):
File “/home/joser/Desktop/Panorama/grc/top_block.py”, line 24, in

import jmr
File “/usr/local/lib/python2.7/dist-packages/jmr/init.py”, line
45,
in
from jmr_swig import *
File “/usr/local/lib/python2.7/dist-packages/jmr/jmr_swig.py”, line
26,
in
_jmr_swig = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/jmr/jmr_swig.py”, line
22,
in swig_import_helper
_mod = imp.load_module(’_jmr_swig’, fp, pathname, description)
ImportError: /usr/local/lib/libgnuradio-jmr.so: undefined symbol:
_ZN2gr6blocks14file_sink_baseD2Ev

Done

The missing symbol above, …file_sink_base… is in
/usr/local/libgnuradio-blocks.so (actually in
libgnuradio-blocks-3.7.2.1.so.0.0.0)
And I believe the above error is caused by not finding the right lib but
I
have tried many things including the suggestions in the FAQ (involving
ldconfig and /etc/ld.so.conf) and I have searched in google with no
luck.

I have looked at swig/jmr_swig.i and the module directory’s
CMakeList.txt
file and can’t determine how Python’s lib load path is set.

Does anyone have any suggestions on how to fix this? thanks,

Jose Rodriguez
[email protected]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jose,

this is an advanced question :slight_smile:
Usually this causes an linker error, but can you verify that you
include the blocks in CMakeLists.txt like the following?

set(GR_REQUIRED_COMPONENTS RUNTIME BLOCKS)

Greetings,
Marcus

On 06.02.2014 20:48, Jose Rodriguez wrote:

grc, I get the following error:
pathname, description) ImportError:
/etc/ld.so.conf) and I have searched in google with no luck.

_______________________________________________ Discuss-gnuradio
mailing list [email protected]
Discuss-gnuradio Info Page

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJS8+2UAAoJEAFxB7BbsDrLTKEIAJEvU9CvGbZL/Y+X562vT3M6
hBSHEcwP/EB1Xz+0dL4sYI3NnBYKL6HthMGEnXdpWHEF+dblqqhvnbYbBWyobeDh
yDSl3Sf+HuGWuuuPXbwY+5Fviln71bxtf03U7zDROA+KNzWKV21L1ftEDzGR0w2d
Qofgi+ria0D32BWq2u+RIosUOrk/6AiUaffjTJ4LyubiFLWpwDAgA9WxQtf1y4P2
o0nfztUxsDnTnKKoo10tdNyBCRfcfpP0pE1aBWNHEA328UP3Hv73toueyIckgCgz
p3ONKUWWEn8pXyAVChyWcw4/wXfzQZjUJG4SK81Wj37eRMBNcAZJQpQc/rzBN94=
=YvXL
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jose,

check correct linking with ‘ldd /usr/local/libgnuradio-jmr.so’.
‘libnguradio-blocks.so’ should appear in the output with the correct
path.

happy hacking
Johannes

On 06.02.2014 20:48, Jose Rodriguez wrote:

builds fine but when I run a flowgraph with file_format_sink using
in swig_import_helper _mod = imp.load_module(‘_jmr_swig’, fp,
including the suggestions in the FAQ (involving ldconfig and

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBAgAGBQJS9B4SAAoJEO7fmkDsqywMoTcP/A8ijsnSBUsP1nKv93jeiFfr
q7kNvgbNiOH6f3Bqd28NTljiKidubt/53tAgc+Wza3tZ1OWKXS/la1R9gApXqRFz
Rfw0NRS7DLt88G4YfGEhCL0BDsilE1j9FnQROFqcGPIz30cQJPS6OVwEkFMDlEy7
VbmcLvhVRADfO4JY6smXxQ/PvMX9EdQf3x/IdPl8vBn47DrO5Sr/oJd0kf70CyVV
p5ZjaWIc2R4WVulMg7x95VOUl/BgDGCEXLR8CLaClcrbo7yOBsGtqCruoa8ZDuJA
ExldRm0Rg0J5DDTWwT1p/fEzjlLfbojrVq/KZ33e9WcPBILFSVLK/8nXOGslT+cD
EYYGGRL2kwpVanr5GhktEvnMN1EQ3OoGp8ahd5+ro0b8PQD1ry2WteDqbaFQ8VT5
jV968jSj3v3ipdk+dmr57+JbKjQPL4uTZAjgdyyWv0lINcR876UQ3Os+MO4yHu86
/I32sKcABgIrNvauG6QRkS9UXVhrCV3VYip//uSYZN7Q3jATEeDdmk4QO2UWKCy1
mfVA9Cwj6lLGuCcVcXC2zPhQNkQ1K6UWeAj1UAg/Er9jf5uHpy0DYRgHVm+IVvQI
ZQflX72NjFGkvLtXvE/23ESGL3LtHAUbQTGLnjRsCY9te+63fVbt7jvdX7Cv6p/h
eEi+UPeAsSHZIeBREL2/
=27j8
-----END PGP SIGNATURE-----