« Return to Thread: Wrapping abstract class

Re: Wrapping abstract class

by stefano ruberto :: Rate this Message:

Reply to Author | View in Thread

Juan Manuel Alvarez wrote:

>> Hi everyone!
>>
>> I am trying to wrap an abstract class to C#, but I always get the
>> "cannot instantiate abstract class" error, since SWIG generates a
>> construction function.
>>    
>
> You should be able to turn off automatic constructor generation with the
> %nodefaultctor feature flag directive. See the manual:
> http://www.swig.org/Doc1.3/SWIGDocumentation.html#SWIGPlus_nn8
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> Swig-user mailing list
> Swig-user@...
> https://lists.sourceforge.net/lists/listinfo/swig-user
>  
I'm trying to solve the same situation..
..the problem is tha you don't have the body of the pure virtual
function .. so eliminating the constructor is not a solution ... I think
...( or I'm wrong ? )...swig  translate the abstract class as a usual
class  ( not interface! ) and try to instantiate it anyway... so you get
that error ... or is there  some news on that?

anyway in the manul page you read .. "Default constructors are not
generated for classes with pure virtual methods or for classes that
inherit from an abstract class, but don't provide definitions for all of
the pure methods."...

Hope this help
Rubio



-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Swig-user mailing list
Swig-user@...
https://lists.sourceforge.net/lists/listinfo/swig-user

 « Return to Thread: Wrapping abstract class

LightInTheBox - Buy quality products at wholesale price