Stephan,
What I am about to write applies to v8-juice and from what I see to cvv8, although we are not using cvv8 yet (since we based ourselves on v8-juice over a year ago and haven't had opportunity to convert to cvv8). This, actually, applies to any type of template library.
v8-juice in it's current form doesn't support windows shared libraries (DLLs). The problem resides in the fact that in windows, all symbols in libraries are private by default (whereas in unix they are public. although i seem to have seen ability to control that in the latest versions of gcc).
In v8-juice a number of core variables (such as OneOfUs, SubclassGetNatives, SubclassGetJSObjects) are created "on-the-fly" by declaring template functions and then returning static variables from these functions.
Unfortunately, in windows, when two DLLs reference the same class/header a private instance of each static variable within a function gets created in each DLL. Thus passing an object from one DLL to another does not work because while it will be created in DLL1, in DLL2 it is not present in a type check array (OneOfUs), consequently failing validation.
The way I have made this work is by forcing all our classes to contain V8_JUICE_DECLARE_CLASS macro, which instantiates OneOfUs, SubclassGetNatives, SubclassGetJSObjects as static members of the wrapped class and modified v8-juice to refer to the wrapped class when obtaining a reference to these arrays.
Unfortunately, I don't think there is a better way to do this because it is not known from which DLL the class originates and the arrays in question must follow import/export declarations of the wrapped class. We can't even wrap the derived class from a template because the arrays in question must be static.
Furthermore, this circumvents ability to wrap an existing class without modifying it. In order to wrap existing classes, we had to derive custom classes and apply this methodology to them...
...
I would like to gather thoughts on the matter. I think Windows support is imperative... and while it breaks the cleanliness of the framework, the ability to have modular structure (i.e. plugins) is imperative...
Unless we can devise a way to create a central map of maps that catalogs all classes wrapped by v8-juice/cvv8 (it may be possible to create a central resolver that would map wrapped classes to map of structures using RTTI)... we should seriously consider reworking the entire library to facilitate this using the above described method...
Anton