Important: Please read the Qt Code of Conduct -

[Solved] Cannot use QtQuick 2.0 in Visual Studio 2010 Express

  • Hi
    I am using Qt5 for a project managed with cmake in Visual Studio 2010 Express. I am able to compile the project, but at run time I get the error:

    module "QtQuick" version 2.0 is not installed.

    This is the CMakeLists.txt file I am using

    if (WIN32)
    set (CMAKE_PREFIX_PATH "C:/Qt/Qt5.0.0/5.0.0/msvc2010")
    set (CMAKE_PREFIX_PATH "/usr/local/Qt-5.0.0")

    find_package (Qt5Declarative)

    include_directories (${CMAKE_SOURCE_DIR}/src ${QT_QTDECLARATIVE_INCLUDE_DIR})


    set (PRJ_HDRS src/window.h)
    set (PRJ src/window.cpp src/main.cpp)
    set (PRJ_RSC qml/res.qrc)
    set (PRJ_MOCS src/window.h)


    add_executable (${CMAKE_PROJECT_NAME} ${PRJ_SRCS} ${RSCS})
    qt5_use_modules(${CMAKE_PROJECT_NAME} Declarative Qml Quick)

  • using import QtQuick 1.0 solves this error, but I am still wondering why I cannot use QtQuick 2.0 when only Qt5.0.0 is istalled on my system (Win7)

  • Moderators

    find_package (Qt5Declarative)

    In QML2, you need to include QtQml and QtQuick modules - not QtDeclarative.

  • I am not following, I use
    qt5_use_modules(${CMAKE_PROJECT_NAME} Declarative Qml Quick)

    which should be enough. In my code I am using


    should I use another class for loading the QML document ?

  • Moderators

    Yes, QQuickView.

  • This solves my problem. Thanks

  • Moderators

    Great :) Please add [Solved] to the topic's title. There are also other header changes in Qt5, you can change them with tool, and/ or the "porting guide":

Log in to reply