SWIG doesn't wrap inherited static functions of derived classes. How it can be resolved?
Here is a simple illustration of the problem.
This is a simple C++ header file:
// file test.hpp
#include <iostream>
class B
{
public:
static void stat()
{ std::cerr << "=== calling static function B::stat" << std::endl; }
void nonstat() const
{ std::cerr << "==== calling B::nonstat for some object of B" << std::endl; }
};
class D : public B {};
The C++ source file just includes the header file:
// file test.cpp
#include "test.hpp"
The SWIG interface file just includes the C++ header file:
// file test.swig
%module test
%{
#include "test.hpp"
%}
%include "test.hpp"
Then I generate the swig wrapper code by this:
swig -c++ -tcl8 -namespace main.swig
And then I create a shared library by this:
g++ -fpic -Wall -pedantic -fno-strict-aliasing \
test.cpp test_wrap.cxx -o libtest.so
So when loading libtest.so in a tcl interpretor and trying to use the wrapped interface, it has the following behavior:
% load libtest.so test
% test::B b
% test::D d
% b nonstat # works fine
% d nonstat # works fine
% test::B_stat # works fine
% test::D_stat # DOESN'T WORK !!
So the question is how can i make SWIG to wrap D::stat?