Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. #include <QWidget> creates compiler error in qmap.h
Forum Updated to NodeBB v4.3 + New Features

#include <QWidget> creates compiler error in qmap.h

Scheduled Pinned Locked Moved Solved Installation and Deployment
7 Posts 4 Posters 326 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Andy314
    wrote 23 days ago last edited by Andy314
    #1

    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 ?

    1 Reply Last reply
    0
    • A Andy314 marked this topic as a regular topic 23 days ago
    • R Offline
      R Offline
      Redman
      wrote 23 days ago last edited by
      #2

      I think you should try to compile it with msvc2022

      A 1 Reply Last reply 23 days ago
      0
      • R Redman
        23 days ago

        I think you should try to compile it with msvc2022

        A Offline
        A Offline
        Andy314
        wrote 23 days ago last edited by Andy314
        #3

        @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.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote 23 days ago last edited by
          #4

          @Andy314 Have you installed all MSVC 2022 patch updates?

          What happens if you try a Hello-World program with the same #include line?

          Qt has to stay free or it will die.

          A 1 Reply Last reply 22 days ago
          1
          • A aha_1980
            23 days ago

            @Andy314 Have you installed all MSVC 2022 patch updates?

            What happens if you try a Hello-World program with the same #include line?

            A Offline
            A Offline
            Andy314
            wrote 22 days ago last edited by
            #5

            @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.

            1 Reply Last reply
            2
            • A Offline
              A Offline
              Andy314
              wrote 22 days ago last edited by
              #6

              Cannot mark it as solved. Tool Topic show not the funktion.

              P 1 Reply Last reply 22 days ago
              0
              • P Pedro marked this topic as a question 22 days ago
              • P Pedro has marked this topic as solved 22 days ago
              • A Andy314
                22 days ago

                Cannot mark it as solved. Tool Topic show not the funktion.

                P Offline
                P Offline
                Pedro
                Qt Community Manager
                wrote 22 days ago last edited by
                #7

                @Andy314 Marked it as solved for you ;)

                It was set as a "normal topic", which disables the Solved/Unsolved feature. :)

                1 Reply Last reply
                0

                1/7

                14 May 2025, 11:56

                • Login

                • Login or register to search.
                1 out of 7
                • First post
                  1/7
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved