[PyQt] Building PyQt on Windows

Jeremy Sanders jeremy at jeremysanders.net
Fri Sep 18 17:19:01 BST 2009

What's the recommended compiler to use to compile Qt and PyQt on Windows?

The free edition of Qt-4.5.2 builds very cleanly with mingw. I did a 
static build of Qt with mingw (gcc 3.4.5) on Windows XP.

I downloaded the Python 2.6.2 binary from the Python website and built the 
latest sip snapshot using the win32-g++ platform. That appears to build 

I then tried the latest PyQt snapshot but it failed:

g++ -c -O2 -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -I"..\..\..\..\Qt\4.5.2\include\QtCore" -I"..\..\..\..\Qt\4.5.2\include\QtGui" -I"..\..\..\..\Qt\4.5.2\include" -I"..\..\..\..\Python26\include" -I"..\..\_qt" -I"." -I"..\..\..\..\Qt\4.5.2\include\ActiveQt" -I"release" -I"..\..\..\..\Qt\4.5.2\mkspecs\default" -o release\qpycore_qstring.o qpycore_qstring.cpp
qpycore_qstring.cpp: In function `QString qpycore_PyObject_AsQString(PyObject*)':
qpycore_qstring.cpp:100: error: invalid conversion from `Py_UNICODE*' to `const ushort*'
qpycore_qstring.cpp:100: error:   initializing argument 1 of `static QString QString::fromUtf16(const ushort*, int)'

This is with PyQt configured using:
configure.py --consolidate -c -j 5 --enable QtCore --enable QtSvg --plugin qjpeg --plugin qtiff --pluginqgif --plugin qsvgicon

Is this a supported configuration? Would it be best to try to build Python 
with mingw or rebuild Qt and PyQt with Visual Studio Express?



Jeremy Sanders <jeremy at jeremysanders.net>
http://www.jeremysanders.net/                Cambridge, UK
Public Key Server PGP Key ID: E1AAE053

More information about the PyQt mailing list