[PD-dev] problem defining t_outlet array
Mathieu Bouchard
matju at sympatico.ca
Thu Jul 17 06:35:56 CEST 2003
On Wed, 16 Jul 2003, Brian Sheehan wrote:
> I'm having problems trying to define an array of type t_outlet. here's
> the code:
> The compiler (gcc3 w/ Project Builder) gives this
> error:
> shapetape.c:17: field `outlets' has incomplete type
> I noticed in m_pd.h that t_outlet is #define'd to
> EXTERN_STRUCT _outlet;
> Does this mean to include some other header for the
> definition of _outlet? The only place I could find a
> definition was m_obj.c...
No, outlet structs are only to be produced by the outlet constructor,
called outlet_new(). It must be called with a t_object argument, and a
type specifier symbol.
You must use pointers to refer to outlets.
In my code I have something like this that does automatic generation of
a variable number of outlets for all of my objects:
self->bself->out = new t_outlet*[noutlets];
for (int i=0; i<noutlets; i++) {
self->bself->out[i] = outlet_new(self->bself,&s_anything);
}
self->bself is a BFObject, subclass of t_outlet.
self->bself->out is a t_outlet **.
________________________________________________________________
Mathieu Bouchard http://artengine.ca/matju
More information about the Pd-dev
mailing list