PyQt6 build issues with GCC 16, related to operator!=
Phil Thompson
phil at riverbankcomputing.com
Tue Aug 11 16:25:04 BST 2026
On 07/08/2026 22:57, Dmitry Shachnev wrote:
> Hi Phil!
>
> With GCC 16.1 in Debian unstable, PyQt6 6.11.0 fails to build with this
> error:
>
> QtCore/sipQtCorecmodule.cpp: In function ‘PyObject*
> slot_QLocale_Language___ne__(PyObject*, PyObject*)’:
> QtCore/sipQtCorecmodule.cpp:8393:32: error: no matching function
> for call to ‘operator!=(QLocale::Language&, const QLocale&)’
> 8393 | sipRes = operator!=(sipCpp, *a0);
> | ~~~~~~~~~~^~~~~~~~~~~~~
> * there are 2 candidates
> In file included from
> /usr/include/x86_64-linux-gnu/qt6/QtCore/qcborvalue.h:9:
> * candidate 1: ‘bool operator!=(QCborTag, QCborKnownTags)’
> /usr/include/x86_64-linux-gnu/qt6/QtCore/qcborcommon.h:65:13:
> 65 | inline bool operator!=(QCborTag t, QCborKnownTags
> kt) { return quint64(t) != quint64(kt); }
> | ^~~~~~~~
> * no known conversion for argument 1 from
> ‘QLocale::Language’ to ‘QCborTag’
>
> /usr/include/x86_64-linux-gnu/qt6/QtCore/qcborcommon.h:65:33:
> 65 | inline bool operator!=(QCborTag t, QCborKnownTags
> kt) { return quint64(t) != quint64(kt); }
> | ~~~~~~~~~^
> * candidate 2: ‘bool operator!=(QCborKnownTags, QCborTag)’
> /usr/include/x86_64-linux-gnu/qt6/QtCore/qcborcommon.h:66:13:
> 66 | inline bool operator!=(QCborKnownTags kt, QCborTag
> t) { return quint64(t) != quint64(kt); }
> | ^~~~~~~~
> * no known conversion for argument 1 from
> ‘QLocale::Language’ to ‘QCborKnownTags’
>
> /usr/include/x86_64-linux-gnu/qt6/QtCore/qcborcommon.h:66:39:
> 66 | inline bool operator!=(QCborKnownTags kt, QCborTag
> t) { return quint64(t) != quint64(kt); }
> | ~~~~~~~~~~~~~~~^~
>
> PyQt6-WebEngine 6.11.0 also fails to build with a similar error:
>
> QtWebEngineCore/sipQtWebEngineCoreQWebEngineFrame.cpp: In function
> 'PyObject* slot_QWebEngineFrame___ne__(PyObject*, PyObject*)':
> QtWebEngineCore/sipQtWebEngineCoreQWebEngineFrame.cpp:458:22:
> error: 'operator!=' not defined
> 458 | sipRes = operator!=((*sipCpp), *a0);
> | ^~~~~~~~~~
>
> This happens with SIP v6.15.3 and v6.16.0, with Python 3.13 and 3.14.
> Our Qt version is 6.10.2 at the moment.
>
> I attached the generated sipQtCorecmodule.cpp for PyQt6, and I can
> provide any
> additional information if you need it.
A C++ expert could probably help...
- the generated code has been working fine for years and years and still
does with other compilers and older versions of GCC
- the problems only seem to be with operator!= and not operator==
- GCC v16 defaults to -std=c++20
The QLocale code expects the corresponding convertor ctor to be invoked
automatically. I've changed the code (tonight's snapshot) to call the
ctor explicitly - see if that improves things.
I am at a loss with the QWebEngineFrame code which doesn't use any
implicit conversions. I've tried building with clang++ with -std=c++20 -
no problems.
Phil
More information about the PyQt
mailing list