discuss-gnuradio
[Top][All Lists]
Advanced

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

[Discuss-gnuradio] Passing Blocks to C++


From: Joshua Stahl
Subject: [Discuss-gnuradio] Passing Blocks to C++
Date: Thu, 12 Jan 2012 20:50:24 -0800

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 "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gr_my/__init__.py", line 40, in <module>
    from gr_my_swig import *
  File "/usr/local/lib/python2.7/dist-packages/gr_my/gr_my_swig.py", line 24, in <module>
    _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<float> 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





reply via email to

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