Discussion:
[PyQt] Compiler error using mingw : invalid new-expression of abstract class type ‘sipQAbstractEventDispatcher’
Erik Janssens
2018-12-02 19:37:18 UTC
Permalink
Hi,

I'm trying to cross compile PyQt using mingw 32bit.

- Using Qt 5.11.2 cross compiled with mingw
- Using sip 4.19.13 cross compiled and native compiled to have sip on
the path
- Using PyQt 5.11.3

I've built sip using the qmake chain, with these options :

python configure.py --use-qmake --target-py-version=3.4.4
--sysroot=/home/tw55413/workspaces/qt/sip/ -p win32-g++
--configuration config.txt --sip-module PyQt5.sip --no-tools
LIBS=-lpython34 -d /home/tw55413/workspaces/qt/sip-install/
--no-stubs --no-dist-info


And configured PyQt with :

python3 configure.py
--destdir=/home/tw55413/workspaces/qt/sip-install/
--no-designer-plugin --no-dist-info --no-docstrings --no-python-dbus
--no-sip-files --no-stubs --no-tools --qmake
/home/tw55413/workspaces/qt/mingw_64/bin/qmake --sip-incdir
/home/tw55413/workspaces/qt/sip/sip-4.19.13/siplib/ --configuration
config.txt --target-py-version 3.4.4 --verbose LIBS+=-lpython34
LIBS+=-L/home/tw55413/workspaces/qt/python/libs
INCLUDEPATH+=/home/tw55413/workspaces/qt/sip/sip-4.19.13/siplib/
--sip
/home/tw55413/workspaces/qt/sip/sip_native/sip-4.19.13/sipgen/sip
QMAKE_CXXFLAGS+=-D_hypot=hypot

Detection of the Qt libraries looks good

After running 'make' the first few files compile, but then I get a
compile error :

/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore/sipQtCoreQAbstractEventDispatcher.cpp:
In function ‘void*
init_type_QAbstractEventDispatcher(sipSimpleWrapper*, PyObject*,
PyObject*, PyObject**, PyObject**, PyObject**)’:
/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore/sipQtCoreQAbstractEventDispatcher.cpp:1137:56:
error: invalid new-expression of abstract class type
‘sipQAbstractEventDispatcher’
             sipCpp = new sipQAbstractEventDispatcher(a0);
                                                        ^
/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore/sipQtCoreQAbstractEventDispatcher.cpp:97:7:
note:   because the following virtual functions are pure within
‘sipQAbstractEventDispatcher’:
 class sipQAbstractEventDispatcher : public ::QAbstractEventDispatcher
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/sip/QtCore/qabstracteventdispatcher.sip:26:0:
../../../mingw_64/include/QtCore/qabstracteventdispatcher.h:100:18:
note:       virtual bool
QAbstractEventDispatcher::registerEventNotifier(QWinEventNotifier*)
     virtual bool registerEventNotifier(QWinEventNotifier
*notifier) = 0;
                  ^~~~~~~~~~~~~~~~~~~~~
../../../mingw_64/include/QtCore/qabstracteventdispatcher.h:101:18:
note:       virtual void
QAbstractEventDispatcher::unregisterEventNotifier(QWinEventNotifier*)
     virtual void unregisterEventNotifier(QWinEventNotifier
*notifier) = 0;
                  ^~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [Makefile.Release:1563:
release/sipQtCoreQAbstractEventDispatcher.o] Error 1
make[2]: Leaving directory
'/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore'
make[1]: *** [Makefile:36: release] Error 2
make[1]: Leaving directory
'/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore'
make: *** [Makefile:42: sub-QtCore-make_first-ordered] Error 2


Any ideas ?

Thanks,

Erik
Erik Janssens
2018-12-03 08:34:06 UTC
Permalink
Hello Phil,

I was able to work around this, by changing configure.py of PyQt, and
modifying line 2456 from :

py.platform == 'win32'

to

py.platform.startswith('win32')

since the platform is 'win32-g++'.

Grts,

Erik
Post by Erik Janssens
Hi,
I'm trying to cross compile PyQt using mingw 32bit.
- Using Qt 5.11.2 cross compiled with mingw
- Using sip 4.19.13 cross compiled and native compiled to have sip on
the path
- Using PyQt 5.11.3
python configure.py --use-qmake --target-py-version=3.4.4
--sysroot=/home/tw55413/workspaces/qt/sip/ -p win32-g++
--configuration config.txt --sip-module PyQt5.sip --no-tools
LIBS=-lpython34 -d /home/tw55413/workspaces/qt/sip-install/
--no-stubs --no-dist-info
python3 configure.py
--destdir=/home/tw55413/workspaces/qt/sip-install/
--no-designer-plugin --no-dist-info --no-docstrings
--no-python-dbus --no-sip-files --no-stubs --no-tools --qmake
/home/tw55413/workspaces/qt/mingw_64/bin/qmake --sip-incdir
/home/tw55413/workspaces/qt/sip/sip-4.19.13/siplib/
--configuration config.txt --target-py-version 3.4.4 --verbose
LIBS+=-lpython34 LIBS+=-L/home/tw55413/workspaces/qt/python/libs
INCLUDEPATH+=/home/tw55413/workspaces/qt/sip/sip-4.19.13/siplib/
--sip
/home/tw55413/workspaces/qt/sip/sip_native/sip-4.19.13/sipgen/sip
QMAKE_CXXFLAGS+=-D_hypot=hypot
Detection of the Qt libraries looks good
After running 'make' the first few files compile, but then I get 
In function ‘void*
init_type_QAbstractEventDispatcher(sipSimpleWrapper*, PyObject*,
error: invalid new-expression of abstract class type
‘sipQAbstractEventDispatcher’
             sipCpp = new sipQAbstractEventDispatcher(a0);
                                                        ^
note:   because the following virtual functions are pure within
 class sipQAbstractEventDispatcher : public ::QAbstractEventDispatcher
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from
note:       virtual bool
QAbstractEventDispatcher::registerEventNotifier(QWinEventNotifier*)
     virtual bool registerEventNotifier(QWinEventNotifier
*notifier) = 0;
                  ^~~~~~~~~~~~~~~~~~~~~
note:       virtual void
QAbstractEventDispatcher::unregisterEventNotifier(QWinEventNotifier*)
     virtual void unregisterEventNotifier(QWinEventNotifier
*notifier) = 0;
                  ^~~~~~~~~~~~~~~~~~~~~~~
release/sipQtCoreQAbstractEventDispatcher.o] Error 1
make[2]: Leaving directory
'/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore'
make[1]: *** [Makefile:36: release] Error 2
make[1]: Leaving directory
'/home/tw55413/workspaces/qt/pyqt/PyQt5_gpl-5.11.3/QtCore'
make: *** [Makefile:42: sub-QtCore-make_first-ordered] Error 2
Any ideas ?
Thanks,
Erik
Loading...