staticforward and C++

Ahmed Bouferguene ahmed.bouferguene at Newlix.com
Wed May 23 12:43:08 EDT 2001


hi Erik,

as a matter of fact,  I have the following situation :

staticforward PyTypeObject Testtype ;

And then after defining the necessary functions (hashfunc, getattrfunc,
...)
I do the dollowing :

static  PyTypeObject Testtype =
{
PyObject_HEAD_INIT(NULL)
.....
} ;

In C, this construction goes smoothly, but not in C++ !? What's the
workaround ??

Thanks.

Erik Max Francis wrote:

> Ahmed Bouferguene wrote:
>
> > I am trying to write an extension in C++. I sort of follwed the same
> > path as when working with C. However,
> >
> > whenever I tried to compile my code, I got this error :
> >
> > a.cc:73: redefinition of `struct PyTypeObject Testtype'
> > a.cc:23: `struct PyTypeObject Testtype' previously declared here
> >
> > Is there a trick I am missing !?
>
> What code you are trying to compile?  It's complaining that you're
> _defininig_ it twice, which is illegal.
>
> --
>  Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
>  __ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
> /  \ Time is a storm in which we are all lost.
> \__/ George Bernard Shaw
>     7 sisters productions / http://www.7sisters.com/
>  Web design for the future.




More information about the Python-list mailing list