Hi,
I have a fairly complex app, that uses plugins and each plugin can export
(bind) its classes to Lua via luabind. The problem is that classes
registered within plugin1 doesn't work inside code registered by plugin2.
Here's an example:
Plugin1:
---------
module(L, "plugin1")
[ class_<Date>("date").def(constructor<int,int,int>()) ]
Plugin2:
---------
module(L, "plugin2")
[ class_<DateTime>("datetime").def(constructor<Date>()) ]
Lua:
---------
d = plugin1.date(2007, 7, 17)
dt = plugin2.datetime(d)
No matching overload found, candidates:
void __init(luabind::argument const&,custom [5Date])
stack traceback:
[C]: ?
[C]: in function 'datetime'
stdin:1: in main chunk
[C]: ?
Both C++ libraries (Plugin1 and Plugin2) use shared implementation of Date
and DateTime classes, so I can use Date class inside C++ Plugin2's code. I
just cannot use it inside Lua. I guess the problem involves type identity
(RTTI, typeid) but I don't know how to fix it. I could merge Plugin1 and
Plugin2 in one big plugin (then it works) but I'd like to have my app more
modular.
--
View this message in context: http://www.nabble.com/Binding-splitted-between-libraries-%28DLLs%29-tp24534417p24534417.html
Sent from the Lua C++ Bind mailing list archive at Nabble.com.
|