From: Pierre Brengard Date: 2002-06-07T17:13:59+09:00 Subject: Re: subclassing SWIG generated c++ class maybe, the generated code lacks the call 'rb_obj_call_init' in the code of the C functions that implement the 'new' Ruby method. Pierre Brengard Martin Man wrote: > hi all, > > I've created simle c++ class > > --- class.cxx --- > #if SWIG > %module myext > #endif > > class Foo { > Foo () {}; > hello_world () {}; > }; > > and then generated ruby extension module 'Myext' using SWIG for it... > no problem so far, I'm able to require the extension, > create instances of Foo, invoke methods, etc. > > but when I try to subclass such class in ruby, the original class gets > always created, am I missing something, e.g. > > --- test.rb --- > require './myext.so' > > module Myext > class Bar < Foo > end > end > > k = Myext::Foo.new > puts k > k1 = Myext::Bar.new > puts k1 > > > both .new statements create instance of Myext::Foo... > > ruby 1.6.7 (2002-03-19) [i386-linux] > swig 1.3.11 > > I'm now trying the cvs versions of SWIG and ruby, but if anyone knows what's > happening... > > greets, > martin >