Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found

Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found

Scheduled Pinned Locked Moved Unsolved Qt 6
qstatemachineqt6
10 Posts 4 Posters 4.3k Views
  • 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.
  • Q Offline
    Q Offline
    QtQrustacean
    wrote on 4 Aug 2021, 19:15 last edited by
    #1

    I'm trying to build a project I have. In Qt 5, it builds fine. In Qt 6.1.2 I get the errors listed in the title of this post, as well as
    'QStateMachine': No such file or directory

    I'm also getting these errors for QState, minus the unknown type error.

    Currently, the official Qt6 Documentation says QStateMachine exists in the language. I know it was not put in right at the 6.0 release, but they added it between then and 6.1.2. Thus it is pretty confusing to be getting these build errors. Any idea what's going wrong here?

    E 1 Reply Last reply 4 Aug 2021, 19:22
    0
    • Q QtQrustacean
      4 Aug 2021, 19:15

      I'm trying to build a project I have. In Qt 5, it builds fine. In Qt 6.1.2 I get the errors listed in the title of this post, as well as
      'QStateMachine': No such file or directory

      I'm also getting these errors for QState, minus the unknown type error.

      Currently, the official Qt6 Documentation says QStateMachine exists in the language. I know it was not put in right at the 6.0 release, but they added it between then and 6.1.2. Thus it is pretty confusing to be getting these build errors. Any idea what's going wrong here?

      E Offline
      E Offline
      eyllanesc
      wrote on 4 Aug 2021, 19:22 last edited by
      #2

      @QtQrustacean said in Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found:

      QStateMachine

      add QT += statemachine in your .pro

      If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

      Q 1 Reply Last reply 4 Aug 2021, 20:16
      3
      • E eyllanesc
        4 Aug 2021, 19:22

        @QtQrustacean said in Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found:

        QStateMachine

        add QT += statemachine in your .pro

        Q Offline
        Q Offline
        QtQrustacean
        wrote on 4 Aug 2021, 20:16 last edited by
        #3

        @eyllanesc said in Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found:

        QT += statemachine

        I tried that at the top of my .pro, and got this build error:
        error: Unknown module(s) in QT: statemachine

        E 1 Reply Last reply 4 Aug 2021, 20:47
        0
        • Q QtQrustacean
          4 Aug 2021, 20:16

          @eyllanesc said in Qt6.1.2: unknown type 'QStateMachine'; 'QStateMachine' file not found:

          QT += statemachine

          I tried that at the top of my .pro, and got this build error:
          error: Unknown module(s) in QT: statemachine

          E Offline
          E Offline
          eyllanesc
          wrote on 4 Aug 2021, 20:47 last edited by eyllanesc 8 Apr 2021, 20:48
          #4

          @QtQrustacean Are you sure you are using Qt6.1 or higher? QStateMachine was moved to a new module called QtStateMachine so you must add QT += statemachine to the .pro as indicated in the docs: https://doc.qt.io/qt-6/qstatemachine.html . Maybe you need to install this module so run the Qt Maintenance Tool and verify that this module is installed, and if not then install it.

          Also it would be good if you indicate what your OS is and how you have installed Qt6

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          Q 2 Replies Last reply 5 Aug 2021, 14:41
          1
          • E eyllanesc
            4 Aug 2021, 20:47

            @QtQrustacean Are you sure you are using Qt6.1 or higher? QStateMachine was moved to a new module called QtStateMachine so you must add QT += statemachine to the .pro as indicated in the docs: https://doc.qt.io/qt-6/qstatemachine.html . Maybe you need to install this module so run the Qt Maintenance Tool and verify that this module is installed, and if not then install it.

            Also it would be good if you indicate what your OS is and how you have installed Qt6

            Q Offline
            Q Offline
            QtQrustacean
            wrote on 5 Aug 2021, 14:41 last edited by
            #5

            @eyllanesc I think so.

            I'm on Windows 10. I downloaded the Qt Online Installer (qt-unified-windows-x86-4.1.1-online.exe) from Qt's site and followed its prompts to install.

            In Qt Creator 4.15.2, when I go to Tools>Options, the Kit auto-detect for my project says Desktop Qt 6.1.2 MinGW 64-bit.

            Q 1 Reply Last reply 5 Aug 2021, 15:16
            0
            • Q QtQrustacean
              5 Aug 2021, 14:41

              @eyllanesc I think so.

              I'm on Windows 10. I downloaded the Qt Online Installer (qt-unified-windows-x86-4.1.1-online.exe) from Qt's site and followed its prompts to install.

              In Qt Creator 4.15.2, when I go to Tools>Options, the Kit auto-detect for my project says Desktop Qt 6.1.2 MinGW 64-bit.

              Q Offline
              Q Offline
              QtQrustacean
              wrote on 5 Aug 2021, 15:16 last edited by
              #6

              @eyllanesc Kit settings.PNG image url)

              1 Reply Last reply
              0
              • E eyllanesc
                4 Aug 2021, 20:47

                @QtQrustacean Are you sure you are using Qt6.1 or higher? QStateMachine was moved to a new module called QtStateMachine so you must add QT += statemachine to the .pro as indicated in the docs: https://doc.qt.io/qt-6/qstatemachine.html . Maybe you need to install this module so run the Qt Maintenance Tool and verify that this module is installed, and if not then install it.

                Also it would be good if you indicate what your OS is and how you have installed Qt6

                Q Offline
                Q Offline
                QtQrustacean
                wrote on 5 Aug 2021, 19:56 last edited by
                #7

                @eyllanesc Ok I used the tool to install Qt State Machines, but when I tried to build without the line QT += statemachine in my .pro file, I got the same errors as before. If I added that line, I got the error: Unknown module(s) in QT: statemachine So even though I installed Qt State Machines, nothing seems to have changed. I confirmed with the maintenance tool that it is actually installed.

                J 1 Reply Last reply 6 Aug 2021, 04:20
                0
                • Q QtQrustacean
                  5 Aug 2021, 19:56

                  @eyllanesc Ok I used the tool to install Qt State Machines, but when I tried to build without the line QT += statemachine in my .pro file, I got the same errors as before. If I added that line, I got the error: Unknown module(s) in QT: statemachine So even though I installed Qt State Machines, nothing seems to have changed. I confirmed with the maintenance tool that it is actually installed.

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 6 Aug 2021, 04:20 last edited by
                  #8

                  @QtQrustacean Did you make sure that you use the auto-detected 6.1.2 Kit for building?

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  Q 1 Reply Last reply 6 Aug 2021, 14:41
                  0
                  • J jsulm
                    6 Aug 2021, 04:20

                    @QtQrustacean Did you make sure that you use the auto-detected 6.1.2 Kit for building?

                    Q Offline
                    Q Offline
                    QtQrustacean
                    wrote on 6 Aug 2021, 14:41 last edited by
                    #9

                    @jsulm Yes, when I click The project name above the icon of a screen to set the build config, it shows 6.1.2 . This is what the toolbar menu action, Build > Open Build and Run Kit Selector opens as well.

                    C 1 Reply Last reply 12 Aug 2021, 18:16
                    0
                    • Q QtQrustacean
                      6 Aug 2021, 14:41

                      @jsulm Yes, when I click The project name above the icon of a screen to set the build config, it shows 6.1.2 . This is what the toolbar menu action, Build > Open Build and Run Kit Selector opens as well.

                      C Offline
                      C Offline
                      ClemRGRA
                      wrote on 12 Aug 2021, 18:16 last edited by
                      #10

                      @QtQrustacean You may need to re-install Qt. I installed the default Qt for Desktop Applications from the installer (6.1.2), and had the same problem you did. By deleting that version of Qt and doing the Custom build, I was able to select Qt 6.1.2 and then add the Qt StateMachine package in the same area. So far, what I did is working.

                      1 Reply Last reply
                      1

                      1/10

                      4 Aug 2021, 19:15

                      • Login

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