[PyQt] PyQt 4.7 build error help?

David Boddie david at boddie.org.uk
Sat Jan 23 16:26:20 GMT 2010


On Sat Jan 23 13:02:19 GMT 2010, Hugo Mallinson wrote:

> Can anyone help a PyQt building newbie?
>
> I'm building PyQt 4.7 against Qt/Embedded 4.6.0 using a just-compiled sip
> 4.10. Sip and Qt built and installed fine, and PyQt configured ok, but I
> get this error very early in the make:

PyQt won't build against the embedded versions of Qt out of the box. You'll
need to modify it.

> g++ -c -pipe -fPIC -O2 -Wall -W -D_REENTRANT -DNDEBUG
> -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public -DQT_NO_DEBUG -DQT_CORE_LIB
> -I. -I/usr/src/PyQt-x11-gpl-4.7/qpy/QtCore -I/usr/include/python2.5
> -I/usr/local/Trolltech/QtEmbedded-4.6.0/mkspecs/default
> -I/usr/local/Trolltech/QtEmbedded-4.6.0/include/QtCore
> -I/usr/local/Trolltech/QtEmbedded-4.6.0/include -o sipQtCoreQThread.o
> sipQtCoreQThread.cpp sipQtCoreQThread.cpp: In function PyObject*
> meth_QThread_currentThreadId(PyObject*, PyObject*):
> sipQtCoreQThread.cpp:329: error: invalid conversion from void* long
> unsigned int sipQtCoreQThread.cpp:329: error: initializing argument 1 of
> PyObject* PyLong_FromUnsignedLong(long unsigned int)
>
> Does anyone know how to fix this? I'm using gcc 4.3.4 and Python 2.5.4,
> both stock from Debian 5.

You need to remove the following line from the sip/QtCore/qthread.sip file:

     static Qt::HANDLE currentThreadId();

The correct solution is to test for the platform being used and only include
this line for platforms for which Qt itself provides this function.

You may encounter similar issues like this, so you might want to look at this
collection of patches:

  http://bitbucket.org/dboddie/pyqt4-for-embedded-linux/

Unfortunately, I haven't yet had time to update them for PyQt 4.7.

David


More information about the PyQt mailing list