Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Visual Studio "Error: Undefined Interface" on header file then cause "QtRunWork" returned "false"
Forum Update on Monday, May 27th 2025

Visual Studio "Error: Undefined Interface" on header file then cause "QtRunWork" returned "false"

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
9 Posts 5 Posters 424 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.
  • S Offline
    S Offline
    setos95
    wrote on last edited by
    #1

    Hello,
    I've been succesfully working on a project with Visual Studio and Qt VS tool extension for last months without any building issues.
    After having accepted a small update on Qt Maintenance tool, my program can't build anymore.
    I get an "Error: Undefined Interface" when proccess applies "moc ../{specific_file}.h" and generates a "QtRunWork has returned false".
    This seems to be linked with the Qt Meta Object Compiler not finding the concerned header file... but I don't know what to do.
    I've been trying to fix it for couple days now.

    jsulmJ 1 Reply Last reply
    0
    • Christian EhrlicherC Christian Ehrlicher moved this topic from General and Desktop on
    • S setos95

      Hello,
      I've been succesfully working on a project with Visual Studio and Qt VS tool extension for last months without any building issues.
      After having accepted a small update on Qt Maintenance tool, my program can't build anymore.
      I get an "Error: Undefined Interface" when proccess applies "moc ../{specific_file}.h" and generates a "QtRunWork has returned false".
      This seems to be linked with the Qt Meta Object Compiler not finding the concerned header file... but I don't know what to do.
      I've been trying to fix it for couple days now.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @setos95 Did you try a complete rebuild (delete build folder, run qmake/CMake, build)?

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

      S 1 Reply Last reply
      0
      • S Offline
        S Offline
        setos95
        wrote on last edited by setos95
        #3
        This post is deleted!
        1 Reply Last reply
        0
        • jsulmJ jsulm

          @setos95 Did you try a complete rebuild (delete build folder, run qmake/CMake, build)?

          S Offline
          S Offline
          setos95
          wrote on last edited by
          #4

          @jsulm
          Of course, it did not work.
          I wonder if this is caused by Qt VS tool extension's recent update for version 3.3.1.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            setos95
            wrote on last edited by setos95
            #5

            I temporarily passed through the error by commenting "Q_INTERFACES()" macro in the concerned header and it runned.
            However, this statement, had never caused issue before...

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

              Hi,

              Can you provide a minimal sample code that reproduces this behaviour ?

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

              1 Reply Last reply
              0
              • M Offline
                M Offline
                m0xf
                wrote last edited by
                #7
                This post is deleted!
                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  m0xf
                  wrote last edited by
                  #8

                  I have some problem.

                  Build log:

                  1>moc Header.h
                  1> E:\Projects\QtUndefinedInterface\Header.h(9): Error: Undefined interface
                  1>C:\Users<cut>\AppData\Local\QtMsBuild\qt_work.targets(138,5): error MSB4181: The "QtRunWork" task returned false but did not log an error.

                  VS Extension 3.3.1 (Visual Studio 2022)
                  https://www.dropbox.com/scl/fi/9tmqplwjdd8q7tyea7sw7/QtUndefinedInterface.zip?rlkey=tuo4iqg7vp0rjugvpajv6murg&st=pnsvx8ok&dl=0

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • M m0xf

                    I have some problem.

                    Build log:

                    1>moc Header.h
                    1> E:\Projects\QtUndefinedInterface\Header.h(9): Error: Undefined interface
                    1>C:\Users<cut>\AppData\Local\QtMsBuild\qt_work.targets(138,5): error MSB4181: The "QtRunWork" task returned false but did not log an error.

                    VS Extension 3.3.1 (Visual Studio 2022)
                    https://www.dropbox.com/scl/fi/9tmqplwjdd8q7tyea7sw7/QtUndefinedInterface.zip?rlkey=tuo4iqg7vp0rjugvpajv6murg&st=pnsvx8ok&dl=0

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote last edited by
                    #9

                    @m0xf Please read the documentation: https://doc.qt.io/qt-6/qqmlparserstatus.html#details

                    "To use QQmlParserStatus, you must inherit both a QObject-derived class and QQmlParserStatus, and use the Q_INTERFACES() macro."

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    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