[PyQt] SIP Problem dynamic loading in wrapped library

Jens Thoms Toerring jt at toerring.de
Wed Mar 30 22:07:07 BST 2011


Hi,

   I have a C++ library which in turn dynamically loads further
shared libraries (for a kind of plugin system), using the Qt
QLibrary class. All this works quite nicely when linking a
C++ program against this library.

I also have a Python wrapper for the library created using SIP
(the version of SIP I've currently installed is 4.10.1). The
problem is now that  when the wrapped library tries to dynami-
cally load the plugins this always fails (both for calls of the
load() and resolve() methods of the QLibrary class). Since with
the QLibrary class there doesn't seem to be a possibility to get
at the error messages from the dynamic linker I replaced the
QLibrary load() method calls with a dlopen() call. This also
fails and dlerror() tells me that when loading the plugin some
symbols are undefined. This seems strange because it works in
the case of a C++ program linked against the library and, as
checks with tools like 'nm' show, those symbols are definitely
defined in the wrapped C++ library (i.e. the one that tries
to load the plugin).

I have no good idea at the moment about the reasons for this
problem. Has anybody experienced a similar situation and per-
haps has found a work-around (or at least an explanation for
what is happening)?
                       Thanks and best regards, Jens
-- 
  \   Jens Thoms Toerring  ________      jt at toerring.de
   \_______________________________      http://toerring.de


More information about the PyQt mailing list