module "QtMultimedia" is not installed
-
Hi all,
I'm testing an .mp3 file in a simple QtQuick (Qt 6.2) app like this:
import QtQuick import QtMultimedia Window { width: 640 height: 480 visible: true title: qsTr("Hello World") MediaPlayer { source: "sounds/startGame.mp3" volume: 0.2 autoPlay: true } }
CMakeLists.txt
:cmake_minimum_required(VERSION 3.16) project(QML_1 VERSION 0.1 LANGUAGES CXX) set(CMAKE_AUTOMOC ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 6.2 COMPONENTS Quick REQUIRED) qt_add_executable(appQML_1 main.cpp ) qt_add_qml_module(appQML_1 URI QML_1 VERSION 1.0 QML_FILES main.qml RESOURCES sounds/startGame.mp3 ) target_compile_definitions(appQML_1 PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>) target_link_libraries(appQML_1 PRIVATE Qt6::Quick)
I get this error: module "QtMultimedia" is not installed
How to solve this, please? -
Hi,
I don't see anything related to the QtMultimedia module in your cmake file.
-
If you mean to work with the following lines:
find_package(Qt6 COMPONENTS Multimedia REQUIRED)
target_link_libraries(mytarget PRIVATE Qt6::Multimedia)I must say, I did!
I tried adding both but then it failed.Is that what you meant. please?
If so, how to solve it that way? -
That's what I had I mind.
Can you build the qmlvideo example from Qt's sources ?
-
If it does, then you know that your installation is fine.
You can then start from it to build your own application.
-
If it does, then you know that your installation is fine.
You can then start from it to build your own application.
-
The second case.
-
I searched for a remedy fort the problem on the Docs, but as usual Docs are not helpful except for one who is quite experienced and just walks through it to be sure about something! :|
All I collected is that I need to add the following two lines in the project's CmakeLists.txt file:
find_package(Qt6 COMPONENTS Multimedia REQUIRED) target_link_libraries(qml_1 PUBLIC Qt::Multimedia)
But the project's CmakeLists.txt file already contains those two lines! Should I replace them with these two ones or merge them?
-
Did you successfully build the example ?
-
Do you meant this example?
I didn't even find it on the Qt Creator examples section!
So how could I build it?
-
My 2 penneth :)
In examples, just type video into the search bar and look for QML Video Example.
But, before you bother with the above example, I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up, might be worth a look.
I recently installed Qt6 and found I could not run any multimedia type apps with the same error you have, but checking maintenance tool, I could see it was not included originally, now it's installed and I have just built a basic test app to run an mp3, it works as expected.
-
My 2 penneth :)
In examples, just type video into the search bar and look for QML Video Example.
But, before you bother with the above example, I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up, might be worth a look.
I recently installed Qt6 and found I could not run any multimedia type apps with the same error you have, but checking maintenance tool, I could see it was not included originally, now it's installed and I have just built a basic test app to run an mp3, it works as expected.
In examples, just type video into the search bar and look for QML Video Example.
I've already done this! :(
I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up
I've already done this one as well! But there's no such an item called
QtMultimedia
to install! :(What is the problem indeed, please? :(
-
You can also clone the QtMultimedia module to get the example code.
-
In examples, just type video into the search bar and look for QML Video Example.
I've already done this! :(
I see no mention of starting the Maintenance Tool and checking that QtMultimedia is actually included/installed in your current set up
I've already done this one as well! But there's no such an item called
QtMultimedia
to install! :(What is the problem indeed, please? :(
@tomy - did you expand your version in the menu?, if you do, you should see "Additional Libraries" in the list, among the contents, you should find QtMultimedia.
In my image, you see I have expanded the version I have installed (Qt 6.2.3)........additional libraries/QtMultimedia.
How odd that you have no examples with your installation, I thought they were automatically included.
-
@tomy - did you expand your version in the menu?, if you do, you should see "Additional Libraries" in the list, among the contents, you should find QtMultimedia.
In my image, you see I have expanded the version I have installed (Qt 6.2.3)........additional libraries/QtMultimedia.
How odd that you have no examples with your installation, I thought they were automatically included.
-
-
@QtWorld said in module "QtMultimedia" is not installed:
why i get this error
Because your code is wrong.
Please look here: https://doc.qt.io/qt-6/qml-qtmultimedia-videooutput.html