[Kde-bindings] Undefined "typeinfo" for KDEDModule while trying to create PtKF5

Shaheed Haque srhaque at theiet.org
Wed Apr 20 19:27:30 UTC 2016


OK, after a bit of poking around, I realised I had not followed the
advice to add the library being bound to the makefile.extralibs. With
that in place, the error changes as follows, here with the linker
command line
 for reference:

g++ -Wl,-Bsymbolic-functions -Wl,-z,relro -shared
-Wl,--version-script=KDBusAddons.exp -o KDBusAddons.so
sipKDBusAddonscmodule.o sipKDBusAddonsKDEInitInterface.o
sipKDBusAddonsKDEDModule.o sipKDBusAddonsKDBusService.o
sipKDBusAddonsKDBusInterProcessLock.o
sipKDBusAddonsKDBusConnectionPool.o -lKF5DBusAddons

And the actual Python error:

$ PYTHONPATH=cxx/KDBusAddons python
Python 2.7.10 (default, Oct 14 2015, 16:09:02)
[GCC 5.2.1 20151010] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import KDBusAddons
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: dynamic module not initialized properly

Using Google, I found several references to this message, but none
seemed relevant [1]. Any suggestions on how to debug this? Or thoughts
on what might be missing?

Thanks, Shaheed

[1] One suggested a missing call to Py_InitModule3...could it be I am
missing some arguments to SIP?

On 9 April 2016 at 16:43, Shaheed Haque <srhaque at theiet.org> wrote:
> [ repost after subscribing, apologies for any dupes ]
>
> Hi,
>
> I'm trying to revive the Python bindings for KDE, starting with KF5.
> I'm having some difficulty with the code generated by the SIP compiler
> in that the compiled code cannot b loaded by Python because of errors
> like this:
>
>>>> import KDBusAddons
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> ImportError: ./KDBusAddons.so: undefined symbol: _ZTI10KDEDModule
>
> And sure enough, if I check the .so file, I see, amongst quite a few other Us:
>
> $ nm -C KDBusAddons.so | grep ' U '
> ...
>                  U typeinfo for KDEDModule
>                  U typeinfo for KDBusService
>                  U typeinfo for KDBusInterProcessLock
> ...
>
> Now my C++ is rather old school and rusty, but having spent a bit of
> time with Google, it seems that I am somehow causing the RTTI support
> not to be generated. Various threads have pointed to the need to
> ensure virtual functions are defined or declared pure and so forth,
> but having tried a few things, I'm rather stuck. I would be most
> grateful for any help on this.
>
> FWIW:
>
> - I am using SIP 4.16 on Ubuntu Wily.
> - I have generated the SIP bindings by running a new clang-based tool
> on the KF5 header files
> - I am using the KF5 header files from Wily.
> - The only code I have locally is the "pykde5.git" repo with my code.
>
> Thanks, Shaheed
>
> P.S. I can provide any code needed, or indeed explain how to use the
> stuff I have pushed to the KDE repos, if that is needed.


More information about the Kde-bindings mailing list