I’ve been trying to get the latest PyQT4 GPL snapshot with QT 4.1.2 working with Mingw32 on a windows box. Had a little bit of trouble in the process, so writing this log so that anyone else who tries this wouldn’t end up wasting time like I did
Start with compiling QT. extract the zip file to some directory and then go to that directory and run “configure -prefix C:\QT\4.1.2″ Its also a good idea to append a “-release” flag to save time by avoiding building the debug version of the libraries.
Once done, run “mingw32-make” and then “mingw32-make install”.
We also need to set two environment variables, QTMAKESPEC and QTDIR
Set QTMAKESPEC to “win32-g++” (without the quotes)
and set QTDIR to the prefix directory specified to configure (In my case, it was “C:\QT\4.1.2″, again without quotes)
Also remember to add the install-path\bin (“C:\QT\4.1.2\bin”) to the PATH
So we’ve got QT installed.
Next up, getting PyQT4 working. extract the PyQt4 zipfile to some directory and run “configure.py”. For some reason, this doesn’t work. PyQt4 looks for libQtCore4.a in “C:\QT\4.1.2\lib” but it isn’t created by the QT.
So, we get pexports and create it.
Download the zip file and extract pexports.exe to the MingGW bin directory.
Then, fire up command prompt and go to the “C:\QT\4.1.2\bin” directory.
type in the following commands
pexports QtCore4.dll > QtCore4.def
dlltool –dllname QtCore4.dll –def QtCore4.def –output-lib libQtCore4.a
move libQtCore4.a ..\lib
Now just go to the PyQT directory
Thats it! We’ve got PyQT installed, provided you did’nt get any further errors
Try running a hello world program from the PyQT4 examples directory.
There’s only one problem I’ve encountered. I haven’t been able to get QT Designer to work.
But I can always go back to Linux for that