Qt 6 errors on Windows
Kornel Benko
kornel at lyx.org
Mon May 24 13:18:56 UTC 2021
Am Mon, 24 May 2021 09:50:27 +0200
schrieb Yu Jin <yu_jin at lyx.org>:
> Am So., 23. Mai 2021 um 09:52 Uhr schrieb Yu Jin <yu_jin at lyx.org>:
>
> > I still can't compile with Qt 6, I just tried again with the recently
> > released Qt 6.1 but I get a lot of these errors:
> >
> > Severity Code Description Project File Line Suppression State
> > Error C2535 'QChar::QChar(ushort) noexcept': member function already
> > defined or declared support (applications\LyX\support)
> > C:\Qt\6.1.0\msvc2019_64\include\QtCore\qchar.h 120
> >
> > Severity Code Description Project File Line Suppression State
> > Error C2572 'qHash': redefinition of default argument: parameter 1 support
> > (applications\LyX\support)
> > C:\Qt\6.1.0\msvc2019_64\include\QtCore\qhashfunctions.h 143
> >
> > Severity Code Description Project File Line Suppression State
> > Error C3615 constexpr function 'qHash' cannot result in a constant
> > expression support (applications\LyX\support)
> > C:\Qt\6.1.0\msvc2019_64\include\QtCore\qhashfunctions.h 143
> >
> > Severity Code Description Project File Line Suppression State
> > Error C2084 function 'size_t qHash(ushort,size_t) noexcept' already has a
> > body support (applications\LyX\support)
> > C:\Qt\6.1.0\msvc2019_64\include\QtCore\qhashfunctions.h 143
> >
> > It looks like these are Qt bugs, but I wanted to ask first before going to
> > Qt and making bug reports... maybe I am missing something. What do you
> > think?
> >
>
> I found what causes this, it is the /Zc compile option. With Qt5 it is set
> to wchar_t and with Qt6 to wchar_t- in all targets, which causes troubles.
> I have changed it in Visual Studio on a test basis and successfully
> compiled LyX, but I guess it would need to be changed in CMake code.
> Kornel, can you help me out here?
This is set at ./CMakeLists.txt:1112
Try to change
if (NOT Qt5Core_FOUND)
to
if (NOT (Qt5Core_FOUND OR Qt6Core_FOUND))
Kornel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: Digitale Signatur von OpenPGP
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20210524/2ff133d4/attachment.asc>
More information about the lyx-devel
mailing list