The problem was on this line

 res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_kdtree, 0 |  0 );

and changing this to

res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0);

solved the problem. I don't understand how structures are accessed. I am unable to find a good tutorial on what needs to be done for passing structures. 

The easy solution for me is to use "void *" as that is sufficient for me. But this may not be a satisfactory solution in a long time.

-mohan



On Tue, Jul 28, 2009 at 3:20 PM, Guillaume Yziquel <guillaume.yziquel@citycable.ch> wrote:
Josh Cherry a écrit :



On Tue, 28 Jul 2009, Guillaume Yziquel wrote:

Then it means that swig doesn't know how to unwrap this pythonised wrapped struct back to C.

I'm not sure how you reach that conclusion.

OK. It seems, at first sight, to mean... but I may well be mistaken.


You lack a typemap somewhere. But I believe you should find more details in the python module's docs. I would be very surprised if this were an arcane issue.

I doubt that.  No custom typemap should be required for a struct pointer.

OK.

Josh

--
    Guillaume Yziquel
http://yziquel.homelinux.org/