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 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?

    eyllanescE 1 Reply Last reply
    0
    • Q QtQrustacean

      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?

      eyllanescE Offline
      eyllanescE Offline
      eyllanesc
      wrote on 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
      3
      • eyllanescE eyllanesc

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

        eyllanescE 1 Reply Last reply
        0
        • Q QtQrustacean

          @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

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by eyllanesc
          #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
          1
          • eyllanescE eyllanesc

            @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 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
            0
            • Q QtQrustacean

              @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 last edited by
              #6

              @eyllanesc Kit settings.PNG image url)

              1 Reply Last reply
              0
              • eyllanescE eyllanesc

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

                jsulmJ 1 Reply Last reply
                0
                • Q QtQrustacean

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

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 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
                  0
                  • jsulmJ jsulm

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

                    Q Offline
                    Q Offline
                    QtQrustacean
                    wrote on 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
                    0
                    • Q QtQrustacean

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

                      • Login

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