Compiling PyQT-2.2

Robert Roy rjroy at takingcontrol.com
Sat Dec 16 14:32:48 EST 2000


On Sat, 16 Dec 2000 17:45:23 GMT, "Marcus Urban"
<MURBAN at houston.rr.com> wrote:

>I've been trying to build PyQt for several days now and it continues to
>fail during the "make install" process. SIP compiles just fine. No
>complaints during ./configure or make/install. PyQt configures fine, too,
>with no complaints. The make process succeeds. But "make install" aborts.
>And yes, QTDIR is set correctly.
>
>
>/bin/sh ../mkinstalldirs /usr/local/lib/python2.0/site-packages
> /usr/bin/ginstall -c -m 644 ./qt.py /usr/local/lib/python2.0/site-packages/qt.py
>make  install-data-hook
>make[3]: Entering directory `/home/urban/py/PyQt-2.2/qt'
>(cd /tmp; PYTHONPATH=/usr/local/lib/python2.0/site-packages:/usr/local/lib/python2.0/site-packages python -c "import qt")
>Traceback (innermost last):
>  File "<string>", line 1, in ?
>  File "/usr/local/lib/python2.0/site-packages/qt.py", line 43, in ?
>    import libqtc
>ImportError: /usr/local/lib/libsip.so.3: undefined symbol: PyObject_Init
>make[3]: *** [install-data-hook] Error 1
>make[3]: Leaving directory `/home/urban/py/PyQt-2.2/qt'
>make[2]: *** [install-data-am] Error 2
>make[2]: Leaving directory `/home/urban/py/PyQt-2.2/qt'
>make[1]: *** [install-am] Error 2
>make[1]: Leaving directory `/home/urban/py/PyQt-2.2/qt'
>make: *** [install-recursive] Error 1


I had some installation problems too. My system is FreeBSD 4.2 with
KDE 1.4x. libqtcmodule.so was finding the wrong version of the
library. The following couple of paragraphs are extracted from an
email I sent to the maintainer of PyQt and describe what I had to do
to get things to work. Your problem sounds different than mine in that
the unresolved symbol you are trying to load is different. Yous might
be a sip problem. Re-run configure for sip and ensure that the output
displays the path to the QT libraries. You might also want to search
the mailing list archives: 

http://mats.gmd.de/mailman/listinfo/pykde 

for "undefined symbol", there is a problem identical to yours listed
there though the solution is not clear.

 http://www.mail-archive.com/pykde@mats.gmd.de/msg00541.html


This is how I fixed my problem:

At the root of this is that libqtcmodule loads libqt.so rather than
the version of the library against which it was built, libqt.so.2.2
(probably no advantage to being more specific). Strangely enough it
does specifically load libSM.so.6. I observed this first hand when I
played with the load paths. This is also consistent with what is in
the output of  'strings libqtcmodules.so'. 

My workaround was to create a symlink from /usr/X11R6/lib/libqt2.2.so
to my libqt.so.2.2.2 library and to change the libqtcmodule_la_LIBADD
string to use '-lqt2.2' instead of -lqt and remake. This is less than
ideal but it works. Ideally the linker would recognize which version
it is linking against and ask for the appropriate file like it does
for libSM. I don't know what prevents this from happening. Perhaps
there is some version value that has to be set in qt.  


Good Luck

Bob



More information about the Python-list mailing list