The main issue is that I need to make some patches to QT5 library in Msys2 to compile with GCC.
I was using QT 5.15.8 withh QMake v3.1
Code: Select all
# patch Qt 5.15.x to build with GCC 12
cd /c/msys64/mingw32/include/
sed -i -e 's/friend Q_CORE_EXPORT uint qHash/\/\/friend Q_CORE_EXPORT uint qHash/g' QtCore/qbitarray.h
sed -i -e 's/friend Q_NETWORK_EXPORT bool operator==/\/\/friend Q_NETWORK_EXPORT bool operator==/g' QtNetwork/qssldiffiehellmanparameters.h
In addition to this old change, I also needed to change the following files.
I am not quite sure if I did it right.
Maybe I need to use QtCreator instead of using Msys2 and Mingw64
In QtGui/qcolor.h file, comment the following two lines
Code: Select all
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QColor &);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QColor &);
In QtCore/qtlocale.h file, comment line 1190
Code: Select all
friend Q_CORE_EXPORT uint qHash(const QLocale &key, uint seed) noexcept;
In QtCore/qregularexpression.h, comment line 171
Code: Select all
friend Q_CORE_EXPORT uint qHash(const QRegularExpression &key, uint seed) noexcept;
In QtCore/qurl.h, comment line 364
Code: Select all
friend Q_CORE_EXPORT uint qHash(const QUrl &url, uint seed) noexcept;
In QtCore/qurlquery.h, comment line 112
Code: Select all
friend Q_CORE_EXPORT uint qHash(const QUrlQuery &key, uint seed) noexcept;
In QtGui/qkeysequence.h, comment line 213 to 215
Code: Select all
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &in, const QKeySequence &ks);
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &in, QKeySequence &ks);
friend Q_GUI_EXPORT uint qHash(const QKeySequence &key, uint seed) noexcept;
In QtGui/qpen.h, comment line 120 to 121
Code: Select all
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QPen &);
friend Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QPen &);
To be continued...