|
From: Sebastian W. <sw...@al...> - 2010-03-16 15:36:55
|
Hello everybody,
I think I have found a serious bug in the Lua bindings of SWIG and hope
you someone else also encountered this problems and found a solution
for this.
Suggest you have two SWIG modules, "A" and "B". Also suggest you use
different namespaces in both modules with equally named classes, say:
library A:
namespace A
{
class classname
{
//! constructor
classname(const std::string & ident);
...
};
}
and library B:
namespace B
{
class classname
{
//! constructor
classname(const int & id);
...
};
}
Then both libraries will be wrapped by SWIG into 2 different modules
and linked together. In Lua, you expect to be able to call:
a = A.classname("hello") -- call constructor of A::classname
b = B.classname( 3 ) -- call constructor of B::classname
SWIG actually merges equally class names from different namespaces into
one. That is, if the load_module routine of module A was called before
B, then it expects the syntax of A::classname, if B.classname( ... ) is
called.
I am using latest SWIG 1.3.40
Any help or suggestions?
I asked here, because the bug tracker on sourceforge is quite inactive
regarding Lua...
Best regards
Sebastian Wolff
|