Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Executable doesn't work, error "QtQuick.Extras" is not installed.



  • Hi there,

    i had a similar problem a few days ago with qmake, but this time i can't find out the origin.

    I transformed the Qt "Dashboard" Example into a CMakeLists.txt project called "DashInCmake" in order to use cmake instead of qmake.
    I finally made it work in the QtCreator, but creating a build folder, where i runcmake .. , make and finally ./DashInCmake turns out the following error:

    QQmlApplicationEngine failed to load component
    qrc:/qml/dashboard.qml:55 module "QtQuick.Extras" is not installed
    qrc:/qml/dashboard.qml:56 module "QtQuick.Timeline" is not installed
    qrc:/qml/dashboard.qml:55 module "QtQuick.Extras" is not installed
    qrc:/qml/dashboard.qml:56 module "QtQuick.Timeline" is not installed
    

    Everything runs perfectly fine in QtCreator. The Kit i use in QtCreator to configurate the project uses my systems cmake: /snap/bin/cmake , therefore i don't get why it's not working in the terminal. In my CMakeLists.txt file i add the package by

    find_package(Qt5 COMPONENTS Quick REQUIRED)
    

    and

    target_link_libraries ("${TARGET_NAME}" Qt5::Quick)
    

    I use:

    cmake version 3.19.2
    Qt version 5.15.2
    Ubuntu 18.04.5 LTS
    amd64

    Does someone has any advice?

    Kind regards



  • Hi,
    I solved the issue but don't know how. I already tried to solve the problem yesterday by adding

    set(CMAKE_PREFIX_PATH "/home/michael/Qt/5.15.2/gcc_64/lib/cmake") 
    

    to the CMakeLists.txt file, but again, everything worked out in the QtCreator, but the Executable created with the Terminal gave me back the error.

    I just repeated the step and suddenly the executable works as well. Maybe it also has something to do with updating my system meanwhile, i don't know.



  • Hi,
    I solved the issue but don't know how. I already tried to solve the problem yesterday by adding

    set(CMAKE_PREFIX_PATH "/home/michael/Qt/5.15.2/gcc_64/lib/cmake") 
    

    to the CMakeLists.txt file, but again, everything worked out in the QtCreator, but the Executable created with the Terminal gave me back the error.

    I just repeated the step and suddenly the executable works as well. Maybe it also has something to do with updating my system meanwhile, i don't know.


  • Lifetime Qt Champion

    Hi,

    Qt Creator will set the CMAKE_PREFIX_PATH to match the Kit you use. When you go to the command line you have to do it yourself. What happens currently is that cmake detects your system installed Qt. Therefore the correct thing to do is to add "-DCMAKE_PREFIX_PATH=<path_to_qt>/lib/cmake" to your cmake call.


Log in to reply