5
votes

I know this is probably something trivial, but I cannot seem to find the answer. I have just completed a fresh install of Scientific Linux 6.5 - which ships with Python 2.6 and Qt 4.6.2. I wish to use the Python interpreter python2.7.8 so downloaded this and installed. I use the QtDesigner for ease when making guis, so then need the PyQt bindings to go with it. I therefore downloaded SIP-4.16.3, configured with:

python2.7 ./configure (in the sip download directory)

to make the bindings for the newer version of python. Everything works fine so far. I then try to install PyQt4.11.2 in the same way:

python2.7 ./configure --qmake=/usr/lib/qt4/bin/qmake -g (to pick up the qt4 version of qmake with static qt libraries)

the configure script completes fine, but I get the following error during 'make':

error: ‘PrintCurrentPage’ is not a member of ‘QAbstractPrintDialog’ ..../Downloads/PyQt-x11-gpl-4.11.2/QtGui/sipQtGuiQAbstractPrintDialog.cpp:1787: error: too many initializers for ‘sipEnumMemberDef’ make[1]: * [sipQtGuiQAbstractPrintDialog.o] Error 1 make[1]: Leaving directory `..../Downloads/PyQt-x11-gpl-4.11.2/QtGui' make: * [all] Error 2

I am at this point a little lost and have been bashing my head for a while, it must be something simple I have missed, any help would be great.

Thanks in advance

2
My opinion: compiling qt (and related) is a royal pain, and you're better off getting a distribution adequate to your needs, in this case perhaps anaconda.mdurant

2 Answers

2
votes
  1. Search string 'PrintCurrentPage' in files of your PyQt-package. You will find it in 4 files.
  2. Remove corresponded lines with string 'PrintCurrentPage'
1
votes

I know this thread is old, but I ran into a similar error installing PyQt4.11.4 by source on a Red Hat Enterprise Linux 5 machine.

I ended up adding the members 'PrintShowPageSize = 0x0008' and 'PrintCurrentPage = 0x0040' to the class definition of QAbstractPrintDialog. This C++ class definition is located in the header file qabstractprintdialog.h. On my distribution, this was located in /usr/lib64/qt4/include/QtGui/.

After adding those missing members, I re-ran make with no compile errors.

The only reason I stumbled onto this solution was looking at this version of qtabstractprintdialog.h here. I noticed my version of the header file was missing those members in the QAbstractPrintDialog class.

I haven't put the new PyQt4 install to use yet, so I can't vouch for functionality just now. But it did compile/install!