#include <QWidget> creates compiler error in qmap.h
-
wrote 23 days ago last edited by Andy314
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 ? -
-
wrote 23 days ago last edited by
I think you should try to compile it with msvc2022
-
wrote 23 days ago last edited by Andy314
@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?
-
@Andy314 Have you installed all MSVC 2022 patch updates?
What happens if you try a Hello-World program with the same #include line?
wrote 22 days ago last edited by@aha_1980 said in #include <QWidget> creates compiler error in qmap.h:
@Andy314 Have you installed all MSVC 2022 patch updates?
That was the problem. After updating all works fine. Thank very much for the hint.
-
wrote 22 days ago last edited by
Cannot mark it as solved. Tool Topic show not the funktion.
-
-
-
@Andy314 Marked it as solved for you ;)
It was set as a "normal topic", which disables the Solved/Unsolved feature. :)
1/7