Tuesday, July 31, 2018

Re: [Discuss-gnuradio] Issue with swig in packet_headerparser block

Hello Marcus,
Thank you very much for your reply. The flag is there. However, I think the problem is with SWIG file because it does not have the correct definitions for packet_header_default.  I copied the packet_header_default.cc from the ofdm gnuradio and put it in my lib directory and copied  packet_header_default.h and put  it in my include directory. So I did not create using gr_modtool add. I add manually all definition and paths but I am not  sure if missed something.  Here is my swig file with definitions I added (I changed the name of the class digitalc) but I am still getting errors. 

/* -*- c++ -*- */

#define DIGITALC_API

%include "gnuradio.i" // the common stuff

//load generated python docstrings
%include "digitalc_swig_doc.i"

%{
#include "digitalc/packet_headerparser_b.h"
#include "digitalc/packet_header_default.h"
%}


%include "digitalc/packet_headerparser_b.h"
%include "digitalc/packet_header_default.h"

GR_SWIG_BLOCK_MAGIC2(digitalc, packet_headerparser_b);


%template(packet_header_default_sptr) boost::shared_ptr<gr::digitalc::packet_header_default>;
%pythoncode %{
packet_header_default_sptr.__repr__ = lambda self: "<packet_header_default>"
packet_header_default = packet_header_default .make;
%}

Here is the error I am getting:

Traceback (most recent call last):
  File "/home/dev/Gnuradio_Prjs/parser/gr-digitalc/python/qa_packet_headerparser_b.py", line 32, in <module>
    import digitalc.digitalc_swig as digitalc
  File "/usr/local/lib/python2.7/dist-packages/digitalc/digitalc_swig.py", line 28, in <module>
    _digitalc_swig = swig_import_helper()
  File "/usr/local/lib/python2.7/dist-packages/digitalc/digitalc_swig.py", line 24, in swig_import_helper
    _mod = imp.load_module('_digitalc_swig', fp, pathname, description)
ImportError: /home/dev/Gnuradio_Prjs/parser/gr-digitalc-debug/lib/libgnuradio-digitalc-1.0.0git.so.0.0.0: undefined symbol: _ZN2gr8digitalc21packet_header_defaultC1ElRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_i

Thanks for the help!
Regards,
Jebreel



Jebreel Salem


On Tue, Jul 31, 2018 at 4:54 AM, Müller, Marcus (CEL) <mueller@kit.edu> wrote:
Looks like your library doesn't export that symbol (in this case, the
constructor of the packet_header_default class). Did you make sure that
the class bears the SPERRY_API flag?

Best regards,
Marcus

On Mon, 2018-07-30 at 16:35 -0500, Jebreel Salem wrote:
> Hi,
> I am trying to create packet_headerparser block. The purpose is to first  duplicate the block and then modify it (mostly I would like to modify the dict part). I followed the the instruction in howto tutorial but I got the error below when I tried to run the  qa_packet_headerparser_b.py. I am not sure what I did wrong but I was able to duplicate demux block and make it work fine. Any hint on this is grealty appreciated.
>
>
> Traceback (most recent call last):
>   File "/home/dev/Gnuradio_Prjs/parser/gr-sperry/python/qa_packet_headerparser_b.py", line 28, in <module>
>     import sperry.sperry_swig as sperry
>   File "/usr/local/lib/python2.7/dist-packages/sperry/sperry_swig.py", line 28, in <module>
>     _sperry_swig = swig_import_helper()
>   File "/usr/local/lib/python2.7/dist-packages/sperry/sperry_swig.py", line 24, in swig_import_helper
>     _mod = imp.load_module('_sperry_swig', fp, pathname, description)
> ImportError: /home/dev/Gnuradio_Prjs/parser/gr-sperry-debug/lib/libgnuradio-sperry-1.0.0git.so.0.0.0: undefined symbol: _ZN2gr6sperry21packet_header_defaultC1ElRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES9_i
>
> Thanks!
>
> Jebreel Salem
>
> _______________________________________________
> Discuss-gnuradio mailing list
> Discuss-gnuradio@gnu.org
> https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment