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
Best regards
Sebastian
Diff:
Seems to have been fixed since as the testcase works with SWIG 4.0.2.
The testcode above was incomplete, so here's what I tested with:
A.i
B.i
runme.lua
runme
If you can still reproduce, please show what you need to change in my working example.