wrapp a function whose parameters are out type pointer to structure using swig

Posted by pierr on Stack Overflow See other posts from Stack Overflow or by pierr
Published on 2010-04-02T06:20:12Z Indexed on 2010/04/02 6:23 UTC
Read the original article Hit count: 335

Filed under:
|
|

I have following function :

typedef struct tagT{
int a ;
int b ;
}Point;

int lib_a_f_5(Point *out_t)
{

out_t->a = 20;
out_t->b = 30;

return 0;
}

How should I direct the SWIG to generate the correct code for ruby (or lua)? When putting following statement to the interface file :

%apply SWIGTYPE Point* {Point *out_t};

I got a warning :

liba.i:7: Warning(453): Can't apply (Point *OUTPUT). No typemaps are defined.

Did i need to write a typemap? How should I do it?

© Stack Overflow or respective owner

Related posts about swig

Related posts about ruby