Passing Blocks to C++

Hello,
I have created a block in c++ which needs to retune after a certain
number
of samples have passed through. To accomplish this I am passing a
uhd_usrp_sink block to my block from python and then I am attempting to
retune after a certain number of samples. The block compiles correctly
and
it runs fine unless I have the retune code in the block. If I attempt
to
retune from c++ I get this message on trying to import the module:

Traceback (most recent call last):
File “”, line 1, in
File “/usr/local/lib/python2.7/dist-packages/gr_my/init.py”, line
40,
in
from gr_my_swig import *
File “/usr/local/lib/python2.7/dist-packages/gr_my/gr_my_swig.py”,
line
24, in
_gr_my_swig = swig_import_helper()
File “/usr/local/lib/python2.7/dist-packages/gr_my/gr_my_swig.py”,
line
20, in swig_import_helper
_mod = imp.load_module(’_gr_my_swig’, fp, pathname, description)
ImportError: /usr/local/lib64/libgnuradio-gr_my-3.3.0.so.0: undefined
symbol: _ZN3uhd14tune_request_tC1Ed

This does not happen if I do not include the line:
sink->set_center_freq((double) ooinfo2[trannumber + 3]);

I am sending my c++ block the usrp sink block through the constructor:
gr_my_amplifier_ff::gr_my_amplifier_ff (std::vector<gr_complex> pre,
std::vector ooinfo, float sps,boost::shared_ptr<uhd_usrp_sink>
sink)

I have tried the fix listed in the FAQ and I have tried including all of
the following headers in the .i file:
#include <gr_uhd_usrp_sink.h>
#include <gr_uhd_api.h>
#include “uhd/types/time_spec.hpp”
#include <uhd/types/time_spec.hpp>
#include “boost/thread/thread.hpp”
#include <boost/make_shared.hpp>
#include <uhd/convert.hpp>

also i have tried including:
%include “uhd_swig.i”

The block compiles and runs fine if I don’t try to access this boost
pointer so I don’t understand why it is not working.

Thanks,
Josh

On 01/12/2012 08:50 PM, Joshua Stahl wrote:

File “/usr/local/lib/python2.7/dist-packages/gr_my/init.py”, line 40,

Its a missing symbol. Try linking your library against libuhd.

-Josh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs