C++ Qt + VS Code + Torizon IDE Extension + CMake....: Could not find moc executable target Qt6::moc


:red_circle: Issue: “Could not find moc executable target Qt6::moc” when trying to build a C++ QT application with VS Code

I am able to successfully build & run my “MyProject” C++ QT6 application using QT Creator but it won’t build in VS Code…

Notes:

  • :green_circle: Sanity Test passes ; I am able to successfully build and deploy a “Hello World” C++ QT application using VS Code
  • :green_circle: CMake file has AUTOMOC ON

HOST

  • Host / Dev Machine: Windows 11
  • Visual Studio Code version 1.89.1
  • Torizon IDE Extension v.2.4.2
  • Qt Configure Extension v0.2.1
  • Qt Tools Extension v0.11.0

CLIENT

  • Device: Apalis iMX8
  • BSP: Ixora
  • Operating System:
  • ID=torizon
  • NAME=“TorizonCore”
  • VERSION=“6.7.0-devel-202405+build.23 (kirkstone)”
  • VERSION_ID=6.7.0-devel-202405-build.23
  • PRETTY_NAME=“TorizonCore 6.7.0-devel-202405+build.23 (kirkstone)”
  • DISTRO_CODENAME=“kirkstone”
  • BUILD_ID=“23”
  • ANSI_COLOR=“1;34”
  • VARIANT=“Docker”

OUTPUT:

[main] Building folder: MyProject
[main] Configuring project: MyProject
[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/home/torizon/MyProject-B/home/torizon/MyProject/build -G “Unix Makefiles”
[cmake] Qt6_DIR is /usr/local/msvc2019_arm64/lib/cmake/Qt6
[cmake] Not searching for unused variables given on the command line.
[cmake] Project Name: MyProject
[cmake] Target Source: main.cpp
[cmake] Target Source: [more confidential info here]
[cmake] set_target_properties
[cmake] target_link_libraries
[cmake] CMAKE_INSTALL_LIBDIR = lib
[cmake] CMAKE_INSTALL_BINDIR = bin
[cmake] QT Version Major: 6
[cmake] QT Version Minor: 4
[cmake] CMake Error: AUTOMOC for target MyProject: Could not find moc executable target Qt6::moc
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
[cmake] – Configuring done
[proc] The command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/home/torizon/MyProject-B/home/torizon/MyProject/build -G “Unix Makefiles” exited with code: 1

CMakeLists.txt:

cmake_minimum_required(VERSION 3.25)
project(MyProject
LANGUAGES CXX
VERSION 0.1.0
DESCRIPTION Prototype
)

set(CMAKE_PREFIX_PATH “/usr/local/msvc2019_arm64”)
set(Qt6_DIR “/usr/local/msvc2019_arm64/lib/cmake/Qt6”)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(QT_VERSION_MAJOR 6)
set(QT_VERSION_MINOR 4)

message(“Qt6_DIR is ${Qt6_DIR}”)

#find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Gui Widgets SerialPort Charts Multimedia VirtualKeyboard)
find_package(QT NAMES Qt6 REQUIRED COMPONENTS Core Widgets SerialPort Charts Gui Multimedia VirtualKeyboard)

set(PROJECT_SOURCES
main.cpp
[more *.cpp files]
[confidential.h files]
[confidential.ui files]
[confidential.qrc files]
)
message(“Project Name: ${PROJECT_NAME}”)

add_executable(${PROJECT_NAME} WIN32
${PROJECT_SOURCES}
)

foreach (file in ${PROJECT_SOURCES})
if ( file MATCHES “.*.cpp$”)
target_sources(${PROJECT_NAME} PRIVATE ${file})
message(“Target Source: ${file}”)
endif()
endforeach()

set_target_properties(${PROJECT_NAME} PROPERTIES
MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
MACOSX_BUNDLE TRUE
WIN32_EXECUTABLE TRUE
AUTOMOC ON
AUTORCC ON
AUTOUIC ON
)
message(“set_target_properties”)
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Widgets
Qt6::SerialPort
Qt6::Charts
Qt6::Core
Qt6::Gui
Qt6::Multimedia
Qt6::VirtualKeyboard
)
message(“target_link_libraries”)
install(TARGETS ${PROJECT_NAME}
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
message(“CMAKE_INSTALL_LIBDIR = ${CMAKE_INSTALL_LIBDIR}”)
message(“CMAKE_INSTALL_BINDIR = ${CMAKE_INSTALL_BINDIR}”)

message(“QT Version Major: ${QT_VERSION_MAJOR}”)
message(“QT Version Minor: ${QT_VERSION_MINOR}”)

Hi, I’m the Toradex AI Assistant. I’m in early beta, and I would appreciate your feedback.
The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello,

The error you’re encountering, “Could not find moc executable target Qt6::moc,” typically indicates that CMake is unable to locate the Meta-Object Compiler (moc) that comes with Qt6. This is essential for processing Qt’s meta-object system, especially when AUTOMOC is enabled. Given that you’ve successfully built and run applications using Qt Creator, it suggests your Qt6 setup is generally correct, but there might be an issue with how it’s being recognized or accessed within the VS Code environment or specifically by CMake when invoked from VS Code.

Here are several steps to troubleshoot and potentially resolve this issue:

  1. Verify Qt6 Installation Path: Ensure that the Qt6 installation path is correctly specified in your CMakeLists.txt. The path you’ve set for Qt6_DIR should point to the directory containing Qt6Config.cmake or qt6-config.cmake. This is crucial for find_package to locate and use Qt6 correctly.

  2. CMake Cache: Sometimes, CMake cache might hold onto outdated paths or settings. Try clearing the CMake cache from within VS Code or manually deleting the CMakeCache.txt file in your build directory, then reconfigure your project.

  3. Environment Variables: Ensure that your environment variables are correctly set up to include paths to Qt6 tools like moc. For VS Code, you might need to adjust your system’s PATH environment variable or define the path within the VS Code settings or the CMakeLists.txt file.

  4. Qt6 CMake Integration: Double-check that the Qt6 integration with CMake is correctly set up. Your find_package call looks correct, but ensure that all required components are listed and that there are no typos or incorrect component names.

  5. VS Code Configuration: Review your VS Code configuration for the C++ and CMake extensions. Ensure that the extensions are up to date and correctly configured to use the correct CMake and compiler toolchain that matches your Qt6 setup.

  6. Check for Typos or Misconfigurations: A common issue can be simple typos or misconfigurations in the CMakeLists.txt file. Double-check all paths, target names, and component names for accuracy.

  7. Use Full Path for moc in CMakeLists.txt: As a last resort, if AUTOMOC is unable to locate moc, you can manually specify the full path to the

Please, also check if these links can help you solve your problem:

Qt on Torizon OS | Toradex Developer Center.

Greetings @miLee,

Did you make any changes to the default template configuration? Most importantly did you install any additional packages in your project? I’ll need to check but I don’t believe the containers used for compilation here have the Qt6 moc binary installed by default.

Best Regards,
Jeremias

Hi @jeremias.tx

  1. “default template configuration” - Are you referring to the CMakeLists.txt? Yes, I made changes. I added it to the above post.

  2. “did you install any additional packages in your project” - Yes, when I setup QT Creator (also known as QT Device), I had to install a Qt Board Support Package called “Qt for Device Creation QBSP 6.7.0”. This is needed for the project.

  3. " I’ll need to check but I don’t believe the containers used for compilation here have the Qt6 moc binary installed by default." - Would my HelloWorld C++ QT application have been built, deployed and run successfully via VS Code if it weren’t there?

After looking at your logs more closely something doesn’t seem right. For example in your logs I can see the following command is executed:

[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/home/torizon/MyProject-B/home/torizon/MyProject/build -G “Unix Makefiles”

But no where in our default projects is such a command defined. Are you sure you are using our extensions to build and compile your application? Or are you just using standard VSCode cmake?

Furthermore your comment here:

Yes, when I setup QT Creator (also known as QT Device), I had to install a Qt Board Support Package called “Qt for Device Creation QBSP 6.7.0”. This is needed for the project.

This doesn’t do anything for our extension. All you did was install the Qt Board Support Package on your development machine. But, our extension works by compiling your application in a container. Therefore the packages on your host (outside of this container) don’t contribute anything to this process.

I did a quick test project using our Torizon extension and here’s a excerpt of the logs from when the application was being compiled:

Build logs
Executing task: DOCKER_HOST= docker run --rm -v /home/coj/test:/home/torizon/app cross-toolchain-arm64-test cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-arm64 

WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Performing Test HAVE_EGL
-- Performing Test HAVE_EGL - Success
-- Found EGL: /usr/include (found version "1.5") 
-- Performing Test HAVE_GLESv2
-- Performing Test HAVE_GLESv2 - Success
-- Found GLESv2: /usr/include  
-- Found XKB: /usr/lib/aarch64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") 
-- Found WrapVulkanHeaders: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/torizon/app/build-arm64
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST= docker run --rm -v /home/coj/test:/home/torizon/app cross-toolchain-arm64-test cmake --build build-arm64 

WARNING: The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
[  4%] Built target test_qmlimportscan
[ 17%] Built target test_tooling
[ 21%] Automatic MOC for target test
[ 26%] Built target test_autogen
[ 30%] Running AUTOMOC file extraction for target test
[ 30%] Built target test_automoc_json_extraction
[ 34%] Running moc --collect-json for target test
[ 39%] Automatic QML type registration for target test
[ 43%] Generating .rcc/qmlcache/test_QML/Scene.ui_qml.cpp
[ 47%] Generating .rcc/qmlcache/test_QML/main_qml.cpp
[ 52%] Running rcc for resource qmake_test
[ 56%] Building CXX object CMakeFiles/test.dir/test_autogen/mocs_compilation.cpp.o
[ 60%] Building CXX object CMakeFiles/test.dir/main.cpp.o
[ 65%] Building CXX object CMakeFiles/test.dir/test_qmltyperegistrations.cpp.o
[ 69%] Building CXX object CMakeFiles/test.dir/build-arm64/.rcc/qrc_qmake_test.cpp.o
[ 73%] Building CXX object CMakeFiles/test.dir/build-arm64/.rcc/qmlcache/test_qmlcache_loader.cpp.o
[ 78%] Building CXX object CMakeFiles/test.dir/build-arm64/.rcc/qmlcache/test_QML/main_qml.cpp.o
[ 82%] Building CXX object CMakeFiles/test.dir/build-arm64/.rcc/qmlcache/test_QML/Scene.ui_qml.cpp.o
[ 86%] Building CXX object CMakeFiles/test.dir/build-arm64/.rcc/qrc_test_raw_qml_0.cpp.o
[ 91%] Linking CXX executable bin/test
[100%] Built target test

Compared with your logs, the commands being executed are different using different arguments, flags, and everything. Also as you can see in my logs from the line Running AUTOMOC file extraction for target test moc seems to be working fine by default without me adding anything extra. I further confirmed by finding the moc binary in the SDK container used for compilation:

torizon@9d2aecf5af1c:~/app$ /usr/lib/qt6/libexec/moc -v
moc 6.4.2

Given all these findings, it would seem you’re not using our VSCode extension properly, if at all.

Best Regards,
Jeremias

Oh you’re right - I wasn’t using Torizon IDE.
I just tried to build with Torizon IDE and got this output:

[05-16 12:30:02.551] Scanning Torizon devices …

[05-16 12:30:02.572] Configuring debug id_rsa …

[05-16 12:30:02.573] Debug id_rsa OK

[05-16 12:30:02.574] Torizon IDE extension activated

[05-16 12:30:03.011] Checking host ip sanity …

[05-16 12:30:03.939] Debian bookworm packages list load OK

[05-16 12:30:04.152] Host ip is OK

[05-16 12:30:04.164] Device 192.168.0.105 set as Docker Host

[05-16 12:40:55.982] ERROR :: build-configure-amd64-local failed with exit code 1

[05-16 19:32:00.639] ERROR :: build-configure-amd64-local failed with exit code 1

[05-16 19:32:35.654] ERROR :: build-configure-arm64 failed with exit code 1

I will work on this. Thank you!

Make sure to reference our documentation on using our VSCode extension: Visual Studio Code IDE Extension | Toradex Developer Center

Best Regards,
Jeremias

1 Like

@jeremias.tx I know what you mean by template, now.
Yes, I started off with the Torizon Qt template when I created the Torizon project in VS Code. I verified that it can build, deploy and run the “Hello World” program.
Then, I added to the same template/project my own files (.h, .cpp, .ui, .qrc) and updated the CMakeLists.txt and main.cpp. This is when build error occurs.

Well there’s a lot to potentially dissect here.

This is when build error occurs.

First of all, what’s the build error? Is it the same as the first one you shared? Different? What are the exact logs of the error?

I added to the same template/project my own files (.h, .cpp, .ui, .qrc) and updated the CMakeLists.txt and main.cpp

You’ve changed a lot of files in the project all at once, this could make it difficult to determine what is causing the issue. If you could change things slowly in smaller steps, it would make it easier in theory to determine what change causes the error.

updated the CMakeLists.txt

Did you update the CMakeLists.txt file to be the same as what you shared in your initial post?

If you did I can already say this probably would cause issues with our extension. For example I can see in your initial CMakeLists.txt that you shared you set several file-paths . Setting these file-paths do not really make sense in our extension. As I said previously our extension works by cross compiling your application within a container. A container has it’s own filesystem. Therefore setting file-paths would not make sense in this context.

Typically from what I’ve seen from other customers they need only to install the libraries they need for their application. Then they customize their project to find and link these libraries against their application. For example see how another customer configured their project in this other thread: Visual Studio Code Qt template

Best Regards,
Jeremias

@jeremias.tx Thank you for the reply. I will get back to you after I resolve this issue here.

Confirmation that the Torizon IDE Extension is activated based on this output:

[06-06 11:14:49.777] Activating Torizon IDE …

[06-06 11:14:49.777] Torizon IDE version :: 2.4.2

[06-06 11:14:50.087] Latest Torizon IDE published :: 2.5.154

[06-06 11:14:50.087] Telemetry is enabled

[06-06 11:14:50.087] Extension collects completely anonymous telemetry data about templates usage. Participation in this anonymous program is optional, and you may opt-out if you’d not like to share any information. Check: https://github.com/toradex/torizon-experimental-torizon-ide-v2-docs/blob/main/USAGE-DATA.md#opt-out

[06-06 11:14:50.087] Telemetry allows us to accurately gauge templates usage. This data will help us to focus better on the most used templates, adding new features and putting effort in the right place.

[06-06 11:14:50.088] Resolving host IP address …

[06-06 11:14:50.731] Host IP address OK

[06-06 11:14:50.796] Docker installed OK

[06-06 11:14:50.849] Docker running OK

[06-06 11:14:51.151] Docker compose OK

[06-06 11:14:51.214] PowerShell OK

[06-06 11:14:51.242] git OK

[06-06 11:14:51.246] dig OK

[06-06 11:14:51.252] avahi-resolve OK

[06-06 11:14:51.256] nmap OK

[06-06 11:14:51.262] iputils-ping OK

[06-06 11:14:51.269] file OK

[06-06 11:14:51.273] sshpass OK

[06-06 11:14:51.282] net-tools OK

[06-06 11:14:51.283] Cloning project templates

[06-06 11:14:51.349] Project templates clone OK

[06-06 11:14:51.816] Project templates fetched OK

[06-06 11:14:51.916] Checkout templates repo to v2.4.2 OK

[06-06 11:14:51.917] Checking connected devices …

[06-06 11:14:51.917] Scanning Torizon devices …

[06-06 11:14:51.924] Configuring debug id_rsa …

[06-06 11:14:51.925] Debug id_rsa OK

[06-06 11:14:51.926] Torizon IDE extension activated

[06-06 11:14:52.108] Checking host ip sanity …

[06-06 11:14:52.593] Host ip is OK

[06-06 11:14:52.655] Device 192.168.0.111 set as Docker Host

[06-06 11:14:53.810] Debian bookworm packages list load OK

Hello, @jeremias.tx !

I followed the steps: Visual Studio Code IDE Extension | Toradex Developer Center
The instructions (lots of information - thank you) in the above link is for creating a new Torizon project in VS Code.

:question: Do you have instructions for importing a pre-existing QT project which was created using QT Creator? Thank you.

Issue: When trying to run the build, it is complaining about it can’t find “qt6::moc”

Build output:


[main] Building folder: MyProject

[main] Configuring project: MyProject

[proc] Executing command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/home/torizon/MyProject -B/home/torizon/MyProject /build -G "Unix Makefiles"

[cmake] Not searching for unused variables given on the command line.

[cmake] -- Configuring done

[cmake] CMake Error: AUTOMOC for target MyProject: Could not find moc executable target Qt6::moc

[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.

[proc] The command: /usr/bin/cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -S/home/torizon/MyProject-B/home/torizon/MyProject/build -G "Unix Makefiles" exited with code: 1

CMakeLists.txt

cmake_minimum_required(VERSION 3.25)

project(MyProject VERSION 0.1 LANGUAGES CXX)

set(CMAKE_PREFIX_PATH )
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(QT NAMES Qt6 REQUIRED COMPONENTS Widgets SerialPort VirtualKeyboard)
#find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets SerialPort Charts Core Gui Multimedia VirtualKeyboard)

set(PROJECT_SOURCES
        main.cpp
        mainwindow.cpp
        mainwindow.h
        mainwindow.ui
        dialog.cpp
        dialog.h
        .**..more header, CPP, ui, qrc files here.**
)

if(${QT_VERSION_MAJOR} GREATER_EQUAL 6.4)
    add_executable(MyProject 
        WIN32
        ${PROJECT_SOURCES}
    )
# Define target properties for Android with Qt 6 as:
#    set_property(TARGET MyProject APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
#                 ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
    if(ANDROID)
        add_library(MyProject SHARED
            ${PROJECT_SOURCES}
        )
# Define properties for Android with Qt 5 after find_package() calls as:
#    set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
    else()
        add_executable(MyProject 
            ${PROJECT_SOURCES}
        )
    endif()
endif()

target_link_libraries(MyProject PUBLIC
    Qt${QT_VERSION_MAJOR}::Widgets
    Qt${QT_VERSION_MAJOR}::SerialPort
    Qt${QT_VERSION_MAJOR}::Charts
    Qt${QT_VERSION_MAJOR}::Core
    Qt${QT_VERSION_MAJOR}::Gui
    Qt${QT_VERSION_MAJOR}::Multimedia
    Qt${QT_VERSION_MAJOR}::VirtualKeyboard
)

set_target_properties(MyProject PROPERTIES
    MACOSX_BUNDLE_GUI_IDENTIFIER my.example.com
    MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
    MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
    MACOSX_BUNDLE TRUE
    WIN32_EXECUTABLE TRUE
)

install(TARGETS MyProject
    BUNDLE DESTINATION .
    LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
    RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

if(QT_VERSION_MAJOR EQUAL 6)
    #qt_finalize_executable(MyProject )
endif()

Confirmation that Torizon IDE Extension is activated (see output in previous post):

While it does look like you have our VSCode extension installed and running now, your logs still appear as if you’re not actually using our extension to build your application. It looks like you’re just building it with the standard cmake tools and not with the Torizon IDE Extension.

Please draw your attention again to how the build logs look for me when I properly use the extension:

Executing task: DOCKER_HOST= docker run --rm -v /home/coj/test:/home/torizon/app cross-toolchain-arm64-test cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -Bbuild-arm64 

WARNING: The requested image's platform (linux/arm64) does not match the detected host platform (linux/amd64/v3) and no specific platform was requested
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/aarch64-linux-gnu-g++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/aarch64-linux-gnu-gcc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- Performing Test HAVE_STDATOMIC
-- Performing Test HAVE_STDATOMIC - Success
-- Found WrapAtomic: TRUE  
-- Performing Test HAVE_EGL
-- Performing Test HAVE_EGL - Success
-- Found EGL: /usr/include (found version "1.5") 
-- Performing Test HAVE_GLESv2
-- Performing Test HAVE_GLESv2 - Success
-- Found GLESv2: /usr/include  
-- Found XKB: /usr/lib/aarch64-linux-gnu/libxkbcommon.so (found suitable version "1.5.0", minimum required is "0.5.0") 
-- Found WrapVulkanHeaders: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /home/torizon/app/build-arm64
 *  Terminal will be reused by tasks, press any key to close it. 

 *  Executing task: DOCKER_HOST= docker run --rm -v /home/coj/test:/home/torizon/app cross-toolchain-arm64-test cmake --build build-arm64 

Compare them to your logs and notice how they look nothing alike. The cmake commands aren’t even using similar arguments. In fact your latest logs still look similar to your original logs you shared at the start of this thread. This leads me to believe you’re still not using the extension to actually build your application here.

:question: Do you have instructions for importing a pre-existing QT project which was created using QT Creator? Thank you.

There’s not really a straightforward method or process for this. You just kind of need to port your code to a project created by our extension and adapt it so that it works with our extension process.

Best Regards,
Jeremias

1 Like

@jeremias.tx Hi!
I am not having the original issue anymore “could not find moc…”
I fixed the cmake file back the way it was when it was simple and working. I thought all this time that it didn’t like my Cmake file but in actuality, the …/cmake directory is missing some Qt subdirectories and files such as Qt6Charts, Qt6SerialPort and QLineSeries.

Thank you

By the way, where do you recommend downloading these missing Cmake subdirectories needed for my Torizon-QT project?

CMake subdirectories in \\wsl.localhost\Torizon\usr\lib\x86_64-linux-gnu\cmake subdirectories:

Qt6 Qt6QmlLocalStorage
Qt6BuildInternals Qt6QmlModels
Qt6Concurrent Qt6QmlTools
Qt6Core Qt6QmlWorkerScript
Qt6CoreTools Qt6QmlXmlListModel
Qt6DBus Qt6Quick
Qt6DBusTools Qt6QuickControls2
Qt6DeviceDiscoverySupportPrivate Qt6QuickControls2Impl
Qt6EglFSDeviceIntegrationPrivate Qt6QuickControlsTestUtilsPrivate
Qt6EglFsKmsGbmSupportPrivate Qt6QuickDialogs2
Qt6EglFsKmsSupportPrivate Qt6QuickDialogs2QuickImpl
Qt6FbSupportPrivate Qt6QuickDialogs2Utils
Qt6Gui Qt6QuickLayouts
Qt6GuiTools Qt6QuickParticlesPrivate
Qt6HostInfo Qt6QuickShapesPrivate
Qt6InputSupportPrivate Qt6QuickTemplates2
Qt6KmsSupportPrivate Qt6QuickTest
Qt6LabsAnimation Qt6QuickTestUtilsPrivate
Qt6LabsFolderListModel Qt6QuickWidgets
Qt6LabsQmlModels Qt6Sql
Qt6LabsSettings Qt6Test
Qt6LabsSharedImage Qt6WaylandClient
Qt6LabsWavefrontMesh Qt6WaylandCompositor
Qt6Network Qt6WaylandEglClientHwIntegrationPrivate
Qt6OpenGL Qt6WaylandEglCompositorHwIntegrationPrivate
Qt6OpenGLWidgets Qt6WaylandGlobalPrivate
Qt6PacketProtocolPrivate Qt6WaylandScannerTools
Qt6PrintSupport Qt6Widgets
Qt6Qml Qt6WidgetsTools
Qt6QmlCompilerPrivate Qt6WlShellIntegrationPrivate
Qt6QmlCore Qt6XcbQpaPrivate
Qt6QmlDebugPrivate Qt6Xml
Qt6QmlDomPrivate VulkanHeaders
Qt6QmlImportScanner expat-2.5.0
Qt6QmlIntegration

I created a new thread for this new issue: