Visual Studio "Error: Undefined Interface" on header file then cause "QtRunWork" returned "false"
-
wrote on 6 Dec 2024, 11:17 last edited by
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. -
-
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.@setos95 Did you try a complete rebuild (delete build folder, run qmake/CMake, build)?
-
wrote on 6 Dec 2024, 14:24 last edited by setos95 12 Jun 2024, 14:29This post is deleted!
-
wrote on 6 Dec 2024, 16:32 last edited by setos95 12 Jun 2024, 16:33
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... -
Hi,
Can you provide a minimal sample code that reproduces this behaviour ?
-
wrote 15 days ago last edited byThis post is deleted!
-
wrote 15 days ago last edited by
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 -
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@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."