Hi,


I'm trying to extend a C++ third part library to Java and I can't override the code of a constructor.


Let say that I have a file MyClass.hpp:

class MyClass{
  public:
    MyClass(){
      cout << "Hello" << endl;
   }
}

Is it possible to override this constructor into the SWIG interface file?

I tried something like:

%ignore MyClass::MyClass();
%include <MyClass.hpp>
%extend MyClass {
  MyClass(){
    cout << "Hello World" << endl;
  }
};

But the ignore statement is still valid when the extend statement is applied. So no constructor is generated.

Can anybody help me? Any suggestion is welcome!


Best regards,
Fabien Rohrer