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 396 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.
  • Andy314A Offline
    Andy314A Offline
    Andy314
    wrote 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
    • Andy314A Andy314 marked this topic as a regular topic
    • R Offline
      R Offline
      Redman
      wrote last edited by
      #2

      I think you should try to compile it with msvc2022

      Andy314A 1 Reply Last reply
      0
      • R Redman

        I think you should try to compile it with msvc2022

        Andy314A Offline
        Andy314A Offline
        Andy314
        wrote 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
        • aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote 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.

          Andy314A 1 Reply Last reply
          1
          • aha_1980A aha_1980

            @Andy314 Have you installed all MSVC 2022 patch updates?

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

            Andy314A Offline
            Andy314A Offline
            Andy314
            wrote 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
            • Andy314A Offline
              Andy314A Offline
              Andy314
              wrote last edited by
              #6

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

              PedroP 1 Reply Last reply
              0
              • PedroP Pedro marked this topic as a question
              • PedroP Pedro has marked this topic as solved
              • Andy314A Andy314

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

                PedroP Offline
                PedroP Offline
                Pedro
                Qt Community Manager
                wrote 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

                • Login

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