Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compile error on 6.0.3
Qt 6.11 is out! See what's new in the release blog

Compile error on 6.0.3

Scheduled Pinned Locked Moved Unsolved General and Desktop
9 Posts 4 Posters 2.6k 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
    angelyouyou
    wrote on last edited by
    #1

    c79b33c9-4a7d-4580-aa5a-73b50568c132-image.png

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You might want to consider providing:

      • The translation of your error
      • The code that triggered it
      • An explanation of what you are doing
      • etc.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • nageshN Offline
        nageshN Offline
        nagesh
        wrote on last edited by
        #3

        @angelyouyou in Qt 6, application attribute Qt::AA_UseHighDpiPixmaps is deprecated.
        As shown in the header file "High-DPI pixmaps are always enabled"

        1 Reply Last reply
        2
        • SGaistS SGaist

          Hi and welcome to devnet,

          You might want to consider providing:

          • The translation of your error
          • The code that triggered it
          • An explanation of what you are doing
          • etc.
          A Offline
          A Offline
          angelyouyou
          wrote on last edited by angelyouyou
          #4

          @SGaist
          Thanks for your help, I have uploaded my project on the github.

          I reinstalled the QT 5.15.2 and 6.0.3 on my windows 10. When I compiled my old project(compiled ok), error occured.
          The part compile error for english version is below:
          F:\Develop\QT\6.0.3\msvc2019_64\include\QtCore/qnamespace.h(464): error C2144: syntax error: "int" should be preceded by "}"
          F:\Develop\QT\6.0.3\msvc2019_64\include\QtCore/qnamespace.h(464): error C2059: syntax error: ""
          F:\Develop\QT\6.0.3\msvc2019_64\include\QtCore/qnamespace.h(493): error C2143: syntax error: missing ";" (before "}")

          1 Reply Last reply
          3
          • G Offline
            G Offline
            Grom
            wrote on last edited by
            #5

            I faced the same problem. I created an empty project with Qt Widgets (Qt 6.0.3 + MSVC) and got very same compile errors in qnamespace.h.
            I removed Qt 6.0.3 and installed Qt 6.1.0, but still no success.
            QtMSVC_errors.png

            1 Reply Last reply
            0
            • nageshN Offline
              nageshN Offline
              nagesh
              wrote on last edited by
              #6

              @Grom Same answer as above
              Did you set any application attribute in widget class?
              If so in Qt 6, application attribute Qt::AA_UseHighDpiPixmaps is deprecated.
              As shown in the header file "High-DPI pixmaps are always enabled"

              1 Reply Last reply
              0
              • G Offline
                G Offline
                Grom
                wrote on last edited by Grom
                #7

                @nagesh No, i didn't. I just created a new Qt Widgets project (Build system: cmake, Base class: QWidget, Generate form: no, Translation: no, Kits: Desktop Qt 6.1.0 MSVC2019 64bit) and pressed Ctrl+B immediately after running cmake on this new project.
                I just tried to remove everything except including QApplication header, but result is same.

                UPD. There are actually a lot of errors in qnamespace.h:

                C1003: error count exceeds 100; stopping compilation
                

                If I remove #include <QApplication>, errors vanish.
                QtMSVC_errors_empty_at_all.png

                1 Reply Last reply
                0
                • nageshN Offline
                  nageshN Offline
                  nagesh
                  wrote on last edited by
                  #8

                  @Grom looks like somebody has reported same bug here

                  G 1 Reply Last reply
                  3
                  • nageshN nagesh

                    @Grom looks like somebody has reported same bug here

                    G Offline
                    G Offline
                    Grom
                    wrote on last edited by
                    #9

                    @nagesh Thanks a lot! It solved my problem.
                    I recently updated my Qt Creator and installed Qt pre-build for MSVC 2019, but did not updated compiler, so MSVC 2019 kit used MSVC 2017 compiler. With 2019 compiler it all works fine.

                    1 Reply Last reply
                    1

                    • Login

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