discuss-gnuradio
[Top][All Lists]
Advanced

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

Re: [Discuss-gnuradio] a programming question about building a block


From: Eric Blossom
Subject: Re: [Discuss-gnuradio] a programming question about building a block
Date: Thu, 13 Sep 2007 12:35:20 -0700
User-agent: Mutt/1.5.9i

On Thu, Sep 13, 2007 at 03:10:17PM -0400, Dawei Shen wrote:
> Hi, Eric
> 
> I didn't put the nested class in the .i file, only the upper-level block
> class, which produced the error (adding it doesn't solve it either). Maybe I
> just shouldn't nest C++ classes when I use SWIG? Thank you.
> 
> Dawei

OK, then I don't think this is a swig problem.

Do you have a virtual destructor defined for your class?
Is it inline, or in the .cc file?  It should be in the .cc file.

Eric







> On 9/13/07, Eric Blossom <address@hidden> wrote:
> >
> > On Thu, Sep 13, 2007 at 02:54:16PM -0400, Dawei Shen wrote:
> > > Hey, Guys
> > >
> > > I encountered a programming problem when I tried to build a new block. I
> > > defined a subclass inside my block class, which looks like:
> > >
> > > class my_block : gr_block{
> > >   class my_subclass {
> > >      sub_class details
> > >   }
> > > }
> > >
> > > Well, this my_subclass is part of my implementation, all its member
> > > functions are inline functions. Everything got compiled and installed
> > well.
> > > However, when I used my block in my python script, I met some error
> > like:
> > >
> > > import _howto
> > > ImportError: /usr/local/lib/python2.5/site-packages/gnuradio/_howto.so:
> > > undefined symbol: _ZN22howto_my_block10my_subclass1hE
> > >
> > > Could anybody help me with this problem? Should I do something with my
> > .i
> > > file or makefile.am file?
> > >
> > > Thank you in advance.
> > >
> > > Dawei
> >
> >
> > SWIG doesn't deal with nested C++ classes.
> > This is a known limitation, and apparently hard to fix.
> >
> > In your case, I doubt that the python code needs to know anything
> > about the implementation details, including the nested class.
> > I suggest trying to remove the nested class from the .i file.
> >
> > Eric
> >




reply via email to

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