[PyKDE] Re: PyKDE

Jim Bublitz jbublitz at nwinternet.com
Fri Aug 8 09:46:21 BST 2003


On Thursday August 7 2003 22:53, Andreas Pour wrote:
> Congrats on the latest release!  I get errors trying to run
> the examples and, sorry to say, am a bit clueless what the
> problem is.  With SuSE 8.1, KDE 3.0.3 and Qt 3.0.5 I get the
> following:

> $ python /usr/share/doc/packages/pykde/examples/uixml.pyc
> Traceback (most recent call last):
>   File "/usr/share/doc/packages/pykde/examples/uixml.py", line
> 5, in ? from kdecore import KApplication
>   File "/usr/lib/python2.2/site-packages/kdecore.py", line 33,
> in ? import libkdecorec
> ImportError:
> /usr/lib/python2.2/site-packages/libkdecorecmodule.so:
> undefined symbol: _ZN10KAccelBase12virtual_hookEiPv

Actually, uixml.py shouldn't do anything. I should re-organize 
the examples section - most of the ui* files are just support 
files for uisampler.py - uixml.py is just the menus for the xml 
section.

However, the problem appears genuine, but I can't reproduce it (I 
have an identical setup - KDE 3.03/Qt3.05/SuSE8.1). I assume you 
already know about the need to 'export KDE_MALLOC=0", as you'd 
probably be getting segfaults otherwise.

The problem is that virtual_hook is a (supressing rant here) 
useless method added to a lot of KDE classes, and since it 
contains no code, the linker throws it out. If you look near the 
bottom of kaccelbase.sip (in the sip/ directory) you should see:

    protected:

    %If (  - KDE_3_1_1 )
    //igx    virtual void         virtual_hook (int, void*);
    %End

The '//' is just a C++ comment, the 'igx' is a directive to my 
code generator to continue to comment this out in all future 
releases, and the %If - %End seems to indicate this method was 
removed (finally) in KDE3.1.1. If it doesn't look like that, 
make it look like that, and then (sorry) re-run build.py, 
compile and install.

Running grep on the sip directory, however, I find the following 
files have virtual_hook methods that aren't commented out:

kaction.sip (*2* instances), kar.sip, knuminput.sip, 
ktextedit.sip and kzip.sip. In each case, all you need to do is 
comment out the offending method:

    virtual void         virtual_hook (int, void*);

should be:

   //    virtual void         virtual_hook (int, void*);

(The 'igx' makes no difference one way or the other for building 
PyKDE - just for my code generator).

My guess is that kaction.sip is causing the problem you're 
seeing. What's strange is that it a) doesn't show up on my 
computer and b) allows modules to load - should generate a link 
error.

I have all of the files patched and will post PyKDE-3.7-2 to 
SourceForge shortly. The problem probably came about when I 
manully edited the files to drop KDE2 support.

> Now the sip files were generated for KDE 3.1.3, but the
> instructions seem to say that is OK, but, alas, I don't think
> it is.  That is b/c when I compile it using SuSE 8.1, KDE
> 3.1.0 and Qt 3.1.1 I get no errors and the example works fine.

The sip files contain conditionals that allow the same set of 
files to build for any supported KDE version (3.0.0 - 3.1.3). 
The examples shouldn't work there (or anywhere), but again, they 
work on all my machines.

> Is it necessary to re-generate the .sip files?  How to do
> that?

Nope - that's what I do.

Sorry for the bugs.

Jim




More information about the PyQt mailing list