On Tuesday, 28 January 2014 at 02:40:40 UTC, Mineko wrote:
I can't remember whether or not I've asked this.. But either way, is it possible to "export" a class or a struct or something like you do with a windows dll with a linux shared library (dll)?
Do you mean loading classes and structs at runtime? You can do this just like in C++ - both library and application should know common base type. Then you need to resolve factory function from library. Factory function may create some derived class instance and return it as base, which known to application. But I'm not sure about GC - you will end up with two garbage collectors, as I presume. This solution also is only for classes, since structs don't support inheritance. Loading structs is more complicated and needs some reflection by hand, but still possible.