Is it truly impossible to write it in straight C?
As far as I know. First, a plugin must define a class which inherits at least from the cbPlugin class. I'll admit that, with a lot of skill and trickery, this can probably be emulated in C -- but, in order to properly register a plugin, C::B needs the
plugin DLL to create a static instance of another class, templated on your cbPlugin inheritor. This static instance in turn registers the plugin class with the main C::B program's plugin set (actually, this takes place in codeblocks.dll, but that's irrelevant). The upshot of all this is that C::B merely calls wxWidget's dynamic DLL loading routines, then examines its list of plugins to find the one that's newly loaded.
On the side of the standard C++ plugin, getting this done is quite easy:
namespace
{
PluginRegistrant<MyPlugin> reg(_T("MyPlugin"));
}
Getting that done somehow in C would be a lot harder, I imagine.
Cheers,
John E. / TDM