#include <QWidget> creates compiler error in qmap.h
-
Hello,
I am on the way from Qt 5.15.2 to 6.7.3. and must build my Creator Plugin (WidgetCollection).I get the compiler errror "Unknown Type" in QMap with MSVC2022
D:\Qt\6.8.3\msvc2022_64\include\QtCore\qmap.h:794: Fehler: C2062: "unknown-type"-Typ unerwartet ..\..\Qt\6.8.3\msvc2022_64\include\QtCore/qmap.h(794): error C2062: "unknown-type"-Typ unerwartet ..\..\Qt\6.8.3\msvc2022_64\include\QtCore/qmap.h(809): note: Siehe Verweis auf die gerade kompilierte Klasse Vorlage-Instanziierung "QMap<Key,T>".
in the following Qt Code
template <typename M, std::enable_if_t<std::is_same_v<M, QMap>, bool> = true> friend QtPrivate::QHashMultiReturnType<typename M::key_type, typename M::mapped_type>
with the following simple code line as first line of a header file
#include <QWidget>
In the old Qt version it works.
Must I use special compiler settings or whats the problem ?
A simple include of a Qt header should compile - or not ? -
A Andy314 marked this topic as a regular topic
-
@Redman said in #include <QWidget> creates compiler error in qmap.h:
I think you should try to compile it with msvc2022
Oh sorry, indeed I use MSVC2022 for it. I will correct the fact in my first post now.
But good idea, I checked: In Qt 6.7.3 MSVC2019 it compiles without problems.
Unfortunately this is not the correct version for the current creator.And with MSVC2022 it compiles too.
Therefore the Qt 6.8.3, the version of the creator, seem to be the problem. -
@Andy314 Have you installed all MSVC 2022 patch updates?
What happens if you try a Hello-World program with the same #include line?
-
P Pedro marked this topic as a question
-
P Pedro has marked this topic as solved