[PyKDE] PyQt - undefined symbol

Jim Bublitz jbublitz at nwinternet.com
Sat Apr 19 08:02:00 BST 2003

On 19-Apr-03 Erik Dahlgren wrote:
> sip -V yields
> 3.5 (build 57)
> I am compiling PyQt from PyQt-x11-gpl-3.5. I looked at the dates
> in site-pakages and as far as I could tell all the ones related
> to qt had todays date (the 18th). When running ldd on
> libqtcmodule.so there is no reference to  libpython of any kind.
> For libsip.so.9 it says not found. Is this a problem? 

My mistake - libpython isn't linked because the interpreter itself
provides those symbols (Duh). It sounds like everything is OK with
sip and PyQt.

> How do I solve it if so?

I found this comment in /usr/lib/python2.2/include/unicodeobject.h:

/* --- UCS-2/UCS-4 Name Mangling ------------------ */

/* Unicode API names are mangled to assure that UCS-2 and UCS-4
builds produce different external names and thus ***cause import
errors*** in case Python interpreters and extensions with mixed
compiled in Unicode width assumptions are combined. */

(my  ***emphasis***)

That kind of problem won't show up until you try to load something
- won't generate a compile or link error.

I don't believe PyQt makes any assumptions about UCS-2 and UCS-4
(and I couldn't tell you the difference anyway). From what you've
said, though, you have a mixed RH8/9 system. My guess from the
comment above is that the version of Python you have is from RH8
and Qt itself (not PyQt) is from RH9 and perhaps RH changed from
UCS2 to UCS4 or vice versa between 8 and 9, or soemthing like that.
(Wild guess).

What you can try is to run nm on libqt-mt.so, libqtcmodule.so and
libpython.a and see if any *UCS* stuff disagrees among the three.
For example:

nm /usr/lib/python2.2/site-packages/libqtcmodule.so | grep PyUnicode

You can also add a " | less" on the end for paging.

In this case you really do want to look at libpython also. You'll
get a bunch of "PyUnicodeUCS2..." symbols (or maybe a 4 instead of
a 2 in one case - that's the problem I'd expect).

Assuming it's an RH version problem, the solution might be to sync
Python and Qt RH versions (eg d/l Python/Python devel for RH9 and
install those). You might also need to recompile sip and PyQt after
doing that, but I'd try it without recompiling if you can (I think
rpm -Uvh should preserve the files in site-packages, but I'm not
sure). It could also be an RH9 bug, but I expect we would have
heard about it already if that's the case. I've tested
sip/PyQt/PyKDE on RH8 and they build fine. I have RH9, but not
installed - I'll try to get to that and test it. You could also
recompile Python on your system - I'm not sure where the UCS choice
comes in, and it might be a problem specific to your system and not
RH, but I think that's the least likely.

If this doesn't work, you can always try sacrificing a goat or two.


More information about the PyQt mailing list