Loading Konqueror sidebar plugins using KLibLoader::library()
faure at kde.org
Tue Sep 26 11:15:58 BST 2006
On Tuesday 26 September 2006 11:24, Matthias Kretz wrote:
> On Tuesday 26 September 2006 10:53, David Faure wrote:
> > On Sunday 24 September 2006 17:07, Krzysztof Lichota wrote:
> > > I have come across the following problem: my Konqueror sidebar plugin
> > > has to export some symbols from its library to be used in its plugins.
> > So you have a plugin which itself has plugins? Interesting ;)
> Well, we've had that all the time with KPartsplugins as well :-)
> > globalLibrary() has always been said to be "the right thing to do".
> I thought it was the opposite. globalLibrary was to be considered as a
> workaround, no?
Well. It's the right thing to do in order for dynamic_cast to work across
plugin boundaries, and using cleanly separated namespaces would be 'right' too,
but indeed this is probably idealistic and breaks easily in practice.
> > So I wouldn't object to it being used there, as long as you check that it
> > still all works - e.g. that the current plugins don't have symbol conflicts
> > with the rest of the code [or with each other?].
> A better fix would be to put the "public" parts of the sidebar plugin into a
> shared lib and let both the sidebar plugin and the the plugin to the sidebar
> plugin link to that lib.
Indeed. I agree. This is in fact what we do in koffice, with e.g. "libkwordprivate.so"
which the part and its plugins link to.
On Tuesday 26 September 2006 12:02, Lubos Lunak wrote:
> Just make sure all of your plugins link against all of their dependencies
> (-no-undefined in LDFLAGS for KDE3, no idea about KDE4).
It's on by default everywhere. No plugins or libs with undefined symbols are
allowed in kde4 code. This is why I moved kdedmodule.cpp to a shared lib (kdecore) :)
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
More information about the kde-core-devel