[PyKDE] Undefined symbols (PyKDE-snapshot20050316)

Jim Bublitz jbublitz at nwinternet.com
Sun Mar 20 19:45:05 GMT 2005


On Sunday 20 March 2005 09:52, Akos Polster wrote:
> So now I can build PyKDE with GCC 4.0 but I'm getting some undefined
> symbols while running (a slightly modified) importTest.py. What am I
> missing?
>
> Testing PyKDE module imports
>
> Modules built:
>   dcop kdecore kdesu kdefx kdeui kio kutils kfile kparts khtml kspell
> kdeprint kmdi
>
> Importing:
>
> dcop
> kdecore
> kdesu
> Traceback (most recent call last):
>   File "importTest.py", line 22, in ?
>     exec ("import " + mod)
>   File "<string>", line 1, in ?
> ImportError: /usr/lib/python2.4/site-packages/kdesu.so: undefined symbol:
> _ZN7KCookie16setDcopTransportERK8QCString

KDE has decided to not export some symbols. The mechanism used is the 
__attribute__ feature of gcc, but the export stuff isn't enabled for gcc<3.4. 
I assume it's in effect for gcc 4.

You can unmangle the missing symbols using c++filt:

jim at jim:~> c++filt _ZN7KCookie16setDcopTransportERK8QCString
KCookie::setDcopTransport(QCString const&)

and then in kdesu/kcookie.sip, comment out (// or /* */) setDCOPTransport. 
Repeat for each missing symbol.

Looking at the KDE source in this particular instance, there isn't anyway to 
tell that KCookie::setDCOPTransport isn't exported. That may mean it's 
peculiar to the distribution you're using (that kind of variability has 
always been the case with KDE/PyKDE). If you find a case where the .sip file 
doesn't explicitly declare the missing method, that would indicate the entire 
class that the missing method is a member of hasn't been exported (sip 
generates code for each inherited method too). From what I've seen, your 
listing looks fairly complete.

At any rate, I don't have a gcc >= 3.4 based distribution available yet (maybe 
the next SuSE release next month?), so I don't see any way to identify these 
ahead of time. PyKDE is generated from the kdelibs h files as defined in the 
source files from kde.org. Until I have a distribution with a more recent gcc 
version than 3.3.x, and until there's some indication of how consistent this 
will be among the various distributions, there isn't much I can do about it. 

If you need to use gcc >= 3.4, you'll have to patch, or you can try the 
kde-bindings version of PyKDE (d/l either the KDE 3.4 source, rpms or CVS) 
which I believe Simon has patched for this problem. I don't know if that 
version has all of the changes for KDE 3.4.0 incorporated yet (there are a 
fair number of new methods and some new classes),  but the missing material 
probably won't be a major drawback.

Jim




More information about the PyQt mailing list