#842 Directors and -fvirtual

closed-duplicate
Marcelo Matus
python (259)
5
2007-07-24
2007-07-24
Andreas Held
No

Consider the following example:

============== test.i ================
%module(directors="1") test
%feature("director");

%{
#include "Class1.h"
%}

%include "Class1.h"

%{
#include "Class2.h"
%}

%include "Class2.h"
==================== Class1.h ============
class Class1 {
public:
Class1() {};

virtual ~Class1() {};

virtual void m1();
virtual void m2();
};
===================== Class2.h ============
class Class2 : public Class1 {
public:
void m1();
void m2();
};
=========== Swig command line ===============
swig -DPYTHON -module test -c++ -python -shadow -modern -dirprot -fastdispatch -fvirtual -o test_wrap.cpp test.i
================ End =====================

Note, that this will not create director code for Class2::m1 and Class::m2. Removing -fvirtual from the command line, creates the correct director code snippets.

This has been tested with swig-1.3.31 on Linux and Windows.

Discussion

  • Andreas Held
    Andreas Held
    2007-07-24

    • status: open --> open-duplicate
     
  • Andreas Held
    Andreas Held
    2007-07-24

    • status: open-duplicate --> closed-duplicate