Dynamic library with an add-on... (again)

Paul Chitescu Paul.Chitescu at IMC-Group.org
Mon Jun 16 16:17:16 CEST 2003


"Amadeo Casas Cuadrado" <acc at tid.es> wrote:
> Hello,
>
> I read the answer of Paul Chitescu and I followed the steps because I
> want to use a dynamic library with the jsdebug add-on, but it doesn't
> work. I've generated a dynamic library (libjsdebug.so) with the
> jsdebug.cpp file. Then I configure Konqueror with --enable-dlopen-addons
> (and not with --enable-add-ons=jsdebug), but it doesn't work.
>
> I don't know if Konqueror doesn't find the dynamic library or if I
> forgot any step. Did someone use the jsdebug add-on as a dynamic
> library? Any idea?
>
> Thanks in advance.

It should be easy to make it work. Please check the debugging output, there
are two possible warning messages of interest (very early in the output,
just after the Launcher::dispatchLoop()... line):

WARNING: failed to load add-on 'libjsdebug.so'
    or
WARNING: add-on 'libjsdebug.so' has no symbol 'konqe_register_libjsdebug'

Did you place the library in the right directory? Does it have read and
execute rights for the user Konq/E runs as? If not you won't see any
message, the library will be simply ignored. Look in main.cc for the
function init_dynamic_addons() and the defines above it to understand how
these get loaded.

Also try to run "nm" on the unstripped libjsdebug.so to see if the proper
symbols are exported and referenced.

I don't know how you generated libjsdebug.so but it MUST NOT include static
code from KJS - ldd should show it depending only on glibc and stdc++ and
all KJS symbols must be undefined - that's why --allow-shlib-undefined must
be passed to ld. This is tricky since it's easy to create shared objects
that won't load at runtime since the linker cannot check if the missing
symbols can be resolved.

--
 Paul Chitescu
 pchitescu at null.ro   http://pchitescu.null.ro/   ICQ:22641673
 Any spammers will be painfully squeezed into /dev/null




More information about the konq-e mailing list