|
[Newbie]:swig wrappers for bootstrapped classes: msg#00181programming.swig
In a swig interface file (sample.i), I need to have the code similar to the following. To understand the scenario, please go through the comments also: =========sample.i============= .... .... class x { .... } %extend x { y __getitem__(...) /* since class y is defined later, I get the error*/ { return y(self, ...); } } %inline %{ .... class y { public: .... y(x *ptr,...):_ptr(ptr) {} /* constructor of class y having x *ptr as one parameter*/ /* You can not cut and paste class y before class x because in that case, class x is not defined. */ .... } %} =========sample.i============= When I compile the generated sample_wrap.cpp, I get the compilation error similar to the following: ----------------------------------- bkcore_wrap.cpp:710: syntax error before `(' bkcore_wrap.cpp: In function `PyObject *_wrap_x___getitem__ (PyObject *, PyObject *)': bkcore_wrap.cpp:3981: `x___getitem__' undeclared (first use this function) bkcore_wrap.cpp:3981: (Each undeclared identifier is reported only once for each function it appears in.) ----------------------------------- The above problem used to work with swig 1.1p5. Breaks with swig 1.3.17. I tried placing "class x", "class y" and "extend x" at different places in sample.i, but without any luck. Any idea how to sort this problem out? Regards, sharma K M
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | typemaps for python lists (double,int) as function arguments: 00181, Marcus Stojek |
|---|---|
| Next by Date: | Re: typemaps for python lists (double,int) as function arguments: 00181, Luigi Ballabio |
| Previous by Thread: | naive question about passing in a NULL via Pythoni: 00181, Scott Koranda |
| Next by Thread: | [Newbie]:swig wrappers for bootstrapped classes: 00181, David Beazley |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |