Build errors (AOT/QV4) in ScriptConsole - Qt Academy Qt3D Training - Qt 6.9 (MacOS)
-
Hi everyone,
I am currently following the Qt 3D training from Qt Academy. I am trying to build the ScriptConsole module on macOS using Qt 6.9.3 (Debug) with CMake and Ninja.
I am encountering multiple compilation errors in the generated QML cache code (.rcc/qmlcache/). It seems like the generated C++ code expects internal APIs that are missing or different in the Qt headers I'm linking against.
/Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:243: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:243:31: error: expected class name 243 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:245: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:245:23: error: no type named 'MarkStack' in namespace 'QV4' 245 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:246: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:246:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 246 | aotContext->mark(v2_0, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:253: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_SystemConsole_qml.cpp:253:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 253 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:961: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:961:31: error: expected class name 961 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:963: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:963:23: error: no type named 'MarkStack' in namespace 'QV4' 963 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:964: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:964:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 964 | aotContext->mark(a1, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:965: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:965:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 965 | aotContext->mark(a2, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:966: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:966:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 966 | aotContext->mark(v2_14, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:967: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:967:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 967 | aotContext->mark(v2_8, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:977: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptContext_qml.cpp:977:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 977 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3758: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3758:31: error: expected class name 3758 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3760: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3760:23: error: no type named 'MarkStack' in namespace 'QV4' 3760 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3761: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3761:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 3761 | aotContext->mark(v2_0, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3762: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3762:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 3762 | aotContext->mark(v2_2, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3771: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3771:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 3771 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3849: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3849:31: error: expected class name 3849 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3851: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3851:23: error: no type named 'MarkStack' in namespace 'QV4' 3851 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3852: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3852:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 3852 | aotContext->mark(v2_0, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3859: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3859:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 3859 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3919: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3919:31: error: expected class name 3919 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3921: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3921:23: error: no type named 'MarkStack' in namespace 'QV4' 3921 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3922: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3922:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 3922 | aotContext->mark(v2_2, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3929: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3929:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 3929 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3975: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3975:31: error: expected class name 3975 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3977: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3977:23: error: no type named 'MarkStack' in namespace 'QV4' 3977 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3978: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3978:17: error: no member named 'mark' in 'QQmlPrivate::AOTCompiledContext' 3978 | aotContext->mark(v2_1, markStack); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3988: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:3988:13: error: no member named 'setLocals' in 'QQmlPrivate::AOTCompiledContext' 3988 | aotContext->setLocals(&s); | ~~~~~~~~~~ ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:4081: error: expected class name /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:4081:31: error: expected class name 4081 | struct Storage : QQmlPrivate::AOTTrackedLocalsStorage { | ^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:4083: error: no type named 'MarkStack' in namespace 'QV4' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/.rcc/qmlcache/scriptconsolemodule_ScriptConsoleItem_qml.cpp:4083:23: error: no type named 'MarkStack' in namespace 'QV4' 4083 | void markObjects(QV4::MarkStack *markStack) const final { Q_UNUSED(markStack); | ~~~~~^ /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/scriptconsolemodule_qmltyperegistrations.cpp:24: error: use of undeclared identifier 'qmlRegisterEnum' /Volumes/MacBookProS/Shrishashank/TrainingSandbox/build/Qt_6_9_3_for_macOS-Debug/ScriptConsole/scriptconsolemodule_qmltyperegistrations.cpp:24:5: error: use of undeclared identifier 'qmlRegisterEnum' 24 | qmlRegisterEnum<ConsoleMessageHandler::MessageType>("ConsoleMessageHandler::MessageType"); | ^ :-1: error: ninja: build stopped: subcommand failed.when i try to run application it's throwig these errors help me on this issue
-
Hi @Chasing_Light,
your thoughts are correct, this code tries to access private API.
You should use the exactly same Qt version as the training course, then it should work.
Regards