Question about boost.extension

Does this library address the problems associated with calling conventions when using different compilers? Can I compile an application with one compiler and allow users to provide plugins compiled with another? I have my doubts that this is even possible to solve, but I ask anyway.

Noah, On Mon, Jul 28, 2008 at 10:48 AM, Noah Roberts <roberts.noah@gmail.com>wrote:
Does this library address the problems associated with calling conventions when using different compilers? Can I compile an application with one compiler and allow users to provide plugins compiled with another?
I have my doubts that this is even possible to solve, but I ask anyway.
No, not really. And it's much worse than just the difference between calling conventions. The issue is that C++ classes (and other things...) can be of different formats when compiled by different compilers, or even different compiler settings. For this reason, if you want to develop plugins that can be compiled by different compilers safely, you should probably stick to functions that pass around simple types (int, float, const char* etc.). Since one can't pass around classes safely, this means no reflection, no factories, no shared objects etc. Since these are what Extension is designed for, I'd recommend another solution. Though you can use the shared_library class in Boost.Extension for this, you really won't get the library's full benefit. What you could do is run the plugin in a separate process, and use inter-process communication, and serialize data between them. Then calling conventions wouldn't matter. It would certainly be a lot more complicated though. It's a good question though, and I'll add it to the FAQ. Jeremy Pack http://boost-extension.blogspot.com

Jeremy Pack wrote:
What you could do is run the plugin in a separate process, and use inter-process communication, and serialize data between them. Then calling conventions wouldn't matter. It would certainly be a lot more complicated though.
Yeah, we're doing that with part of our project currently. We hate it. It's a nightmare to try to debug. That's probably our fault though. Thanks for the quick answer.
participants (2)
-
Jeremy Pack
-
Noah Roberts