How to install module "QtMultimedia" on Windows
-
When I run a QML project on my Windows machine, I get the errors below on Qt Creator:
qrc:/main.qml:4:1: module "QtMultimedia" is not installed
qrc:/main.qml:5:1: module "QtQuick.Dialogs" is not installedHow to install those two modules? I look them up on the web but couldn't find a handy resource on how to that.
-
@qcoderpro said in How to install module "QtMultimedia" on Windows:
How to install those two modules?
How did you install Qt and which version?
-
@qcoderpro Can you show how you're importing these modules?
-
@qcoderpro said in How to install module "QtMultimedia" on Windows:
import QtMultimedia 5.15
I think it should be 5.12 as you're using Qt 5.12 not 5.15
-
Hi,
Did you add
QT += multimedia
to your .pro file ? -
I get the error below after adding that line in the .pro file:
:-1: error: Project ERROR: Unknown module(s) in QT: multimediaAnd this is the .pro file contents:
QT += quick CONFIG += c++11 QT += multimedia # The following define makes your compiler emit warnings if you use # any Qt feature that has been marked deprecated (the exact warnings # depend on your compiler). Refer to the documentation for the # deprecated API to know how to port your code away from it. DEFINES += QT_DEPRECATED_WARNINGS # You can also make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ main.cpp RESOURCES += qml.qrc # Additional import path used to resolve QML modules in Qt Creator's code model QML_IMPORT_PATH = # Additional import path used to resolve QML modules just for Qt Quick Designer QML_DESIGNER_IMPORT_PATH = # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target DISTFILES += \ android/AndroidManifest.xml \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.jar \ android/gradle/wrapper/gradle-wrapper.properties \ android/gradlew \ android/gradlew.bat \ android/res/values/libs.xml contains(ANDROID_TARGET_ARCH,armeabi-v7a) { ANDROID_PACKAGE_SOURCE_DIR = \ $$PWD/android }
-
Did you re-run qmake after adding that line ?
-
Yes, I did it but no change in the outcome! :(
I thought of making a new project with the same title and files this time using the CMake build system.
I've not used CMake yet. Should I add the
QT += multimedia
line in the CMakeLists.txt file and retest the project after re-running CMake? -
@qcoderpro Do you have more than one Kit? If so do you use the one where Qt has multimedia module?
-
@qcoderpro As I suspected, you are confusing the version with which QtCreator was compiled (5.15.2) with the Qt you have installed (Qt 6.0.0). If you analyze the second image you will see that "C:/Qt/6.0.0/mingw81_64/lib/..." says where it is concluded that you are using Qt 6.0.0. Solution: Download Qt5 and remove Qt6 so you don't have that kind of problem
-
the version with which QtCreator was compiled (5.15.2) with the Qt you have installed (Qt 6.0.0).
Can't we have Qt 6 for both the compiled and installed versions to get rid of this problem and also have the most up-to-date Qt version?
Download Qt5 and remove Qt6 so you don't have that kind of problem
You mean to unselect Qt 6.0.0 and select Qt 5.15.2?
So what are those Qt 6.0.0 and Qt 6.0.1 for? -
@qcoderpro I recommend you select 5.15.2 and deselect Qt 6.0.0.
Qt 6.x.y is a new version (with many internal changes) but so far the multimedia module has not been added. See this https://stackoverflow.com/questions/65213872/qt6-and-multimedia-module.
-
@qcoderpro said in How to install module "QtMultimedia" on Windows:
Help menu says I'm using 5.15 while the kit is 6!
No, it says what Qt version was used to build QtCreator, not what Qt you're using.
-
@qcoderpro said in How to install module "QtMultimedia" on Windows:
So is the proper way to see the Qt version installed to look at the version of the kits' Qt, please?
Yes