[PATCH] kcmoduleinfo [WAS] Plugin linking problem

David Faure faure at kde.org
Thu Aug 9 22:42:44 BST 2007

On Thursday 09 August 2007, Rafael Fernández López wrote:
> When it tries to load the KCM factory from the library it will fail, because
> if the library is " foo.so", it will try to load from "kcm_foo.so", what
> won't find.

I understand that... you basically repeated your previous email, but you haven't answered my post at all...

OK you have a plugin in foo.so, and you want to load it as foo.so, so you removed the
auto-prepending of "kcm_". Fine. But you said that the reason for doing so was that
foo.so is also a plugin for something else, like a ktexteditor plugin. So my question is:
how can one library ship both one ktexteditor plugin and one kcmodule plugin, given that
(AFAICS) they are all provided by the same C function ("entry point"), called init_foo()?
(or in your example, init_ktexteditor_docwordcompletion). That function can either create
a factory for a ktexteditor plugin OR a factory for a kcmodule plugin, but not both (at least
not with the standard use of the K_EXPORT... macro, it would require the use of more elaborate
kgenericfactory magic to do that, iirc).

Does it really work? Do you have one plugin playing both roles? Please run nm on it and grep for init_
and tell me what you see, if the above is chinese to you :)
 (and tell me how you used K_EXPORT_... and factories)

Hopefully I'm wrong, but I smell a breakage here.

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 mailing list