Although there is no method to directly share classes between modules (e.g. import) you can share object indirectly through interfaces. Unfortunately there is a small problem that prevents the called method from accessing global variables. I have narrowed the solution down to a single line change and was all current tests passed.
-- EDIT --
I've reduced this down to a single line change. I don't have a plain copy of 2.11.2 installed but it's not difficult to change:
Open up as_context.cpp and go to CallScriptFunction:
void asCContext::CallScriptFunction(asCModule *mod, asCScriptFunction *func)
{
// Push the framepointer, functionid and programCounter on the stack
PushCallState();
currentFunction = func;
module = mod;
...
}
And...
// Change:
module = mod;
// To:
module = func->module ? func->module : mod;
This should correct all calling of object methods and functions across modules.
[**EDIT** Updated source name from .h to .cpp]
[Edited by - Digital_Asphyxia on February 13, 2008 11:31:25 AM]