Linking a plugin with kdelibs / manually

Etan Reisner pidgin at unreliablesource.net
Mon Mar 24 19:34:16 EDT 2008


On Sun, Mar 23, 2008 at 09:46:07PM +0100, cfchris6 wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello,
>
> I am writing my first plugin for libpurple at the moment. It is a core plugin and makes use of the dcop_call() function, declared in "dcop/dcopc.h" which is part of the kdelibs sources.
> The plugin gets compiled and linked correctly, still using the plugins makefile with helloworld.so target, because I nowhere found an example on how to compile and link a plugin using simply gcc and ld.
> But when I try to load the plugin in Pidgin it complains the symbol dcop_call is undefined, so probably I need to link that function in statically. (if possible this would be the best)
> So how are the commands to build a libpurple plugin just using gcc and ld and link in an external library statically?
>
> Christian Franke

To link a plugin to an external library you need to include the
-l<libraryname> flag on the link line. You might be able to use:
    PLUGIN_LIBS="-l<whatever>" make <pluginname>.so
from the plugins/ directory and have it work.

    -Etan




More information about the Devel mailing list