From: William S F. <ws...@fu...> - 2008-01-10 23:05:18
|
patrickinminneapolis wrote: > I have a function defined in the wrapper file as > mapcore::ConnectionConditionIterator getConnectionConditions(mapcore::Heap > &heap=mapcore::AlObject::getHeap(), mapcore::Error > *pError=mapcore::Error::nullError()) const; > > > the return object has a constructor (from the header) > explicit ConnectionConditionIterator(const NetworkTileSpec &tileSpec, Heap& > heap = AlObject::getHeap(), Error *pError = Error::nullError()); > > There are no other constructors for the class ConnectionConditionIterator > > This generates the swig c++ code > SWIGEXPORT void * SWIGSTDCALL > CSharp_Link_getConnectionConditions__SWIG_0(void * jarg1, void * jarg2, void > * jarg3) { > void * jresult ; > mapcore::Link *arg1 = (mapcore::Link *) 0 ; > mapcore::Heap *arg2 = 0 ; > mapcore::Error *arg3 = (mapcore::Error *) 0 ; > mapcore::ConnectionConditionIterator result; //ERROR > ... > > The problem is there is no default constructor defined for > ConnectionConditionIterator and therefore a compilation error, C2512, > occurs. I am using the %nodefaultctor and %nodefaultdtor directives > globally. I'm a bit lost, thanks for your help. > SWIG must parse the ConnectionConditionIterator class before it parses getConnectionConditions() in order to see that this class has no default constructor. That is the first thing to make sure you have right. SWIG will then use the SwigValueWrapper to work around the problem you describe. You can also force the use of SwigValueWrapper using %feature("novaluewrapper"). Maybe the %nodefaultctor feature is stopping this from working, in which case use clear the defaultctor feature for the ConnectionConditionIterator class. William |