[C++-sig] [Swig-user] Why this does not work- overriding C++ virtualfunctions in python script?

Bruce Who bruce.who.hk at gmail.com
Thu May 10 04:17:36 CEST 2007


Hi,

Thanks for all of you. It finally works.

I have tried swig/testswig/python/extend, and the unexpected_handler
issue still exists. I solve this as what I said in my previous post.
The script swig/testswig/python/extend/runme.py runs with errors:

Runtime Error!
Program: D:\program\Python25\python.exe
abnormal program termination

and I find that this error is caused by this call ``e.getName()''. I
think swig is not very friendly to win32 users.

However, the only difference between my .i file and the example.i is
that the order of #include and %include, this is my original .i file:


%module(directors="1") cmod
%include "cmod.h"

%feature("director");

%inline %{
#include "cmod.h"
%}


so I change it to:

%module(directors="1") cmod

%inline %{
#include "cmod.h"
%}

%feature("director");

%include "cmod.h"


then compile all files and run my script and everything goes fine!



Bruce



More information about the Cplusplus-sig mailing list