Important: Please read the Qt Code of Conduct -

Add Multimedia Widgets to Qt Creator C++ project for Raspberry Pi

  • Hi,
    I am trying to compile a Qt5 project that should play a video, and I found the Multimedia widget could be used for it. The problem is that when I add the line:

    QT +=    multimediawidgets 

    on my file, it gives me a build error:

        :-1: error: Unknown module(s) in QT: multimedia multimediawidgets

    Then I tryied to install the missing module with:

    sudo apt-get install qtmultimedia5-dev

    but I did not succeed.
    Does anyone know what am I missing or what am I doing wrong?
    How I can build a Qt project including multimedia features?
    Thanks a lot!

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What error did you get when trying to install that package ?

  • Hi! I didn't get any error when I installed that package on Ubuntu, the problem is that my Qt project fails the build anyway. I get the same error "Unknown module(s) in QT: multimedia multimediawidgets" even though that package is now installed!
    Looking at Ubuntu Software Centre, "Qt Multimedia Widgets Module" seems to be installed!

  • Lifetime Qt Champion

    Are you cross-compiling for the Raspberry Pi ?

  • Yes, I'm cross-compiling for the Raspberry Pi on Ubuntu! Sorry, I did not mentioned before:)
    The Multimedia package seems to be installed.. perhaps have I to add some additional compilation directives on Qt project properties?

  • Lifetime Qt Champion

    It looks like you don't have qtmultimedia for RPI. Did you build it for RPI?

  • The problem is when I build at the desktop side. I have already installed the multimedia package on my Ubuntu machine with "sudo apt-get install qtmultimedia5-dev". Have I to install other kind of package for the RPi? How can I check if I build the qtmultimedia for RPI?

  • Lifetime Qt Champion

    It doesn't matter whether you installed it on your host machine. If you cross-compile then you need it for your target device and not your host (Ubuntu).

  • Ok, so you mean I have to install QtMultimedia package on my Raspberry Pi?
    By the way, the compiling error is shown when I build in Qt on my host machine, hence before deploying the program on the RPi!

  • Lifetime Qt Champion

    "By the way, the compiling error is shown when I build in Qt on my host machine, hence before deploying the program on the RPi!" - sure, if you cross-compile without QMultimedia for Pi. I guess you already have Qt cross-compiled for Pi, right? Now you need QMultimedia cross-compiled for Pi as well.

  • Ok, I see, thanks! Which are the steps I should do to cross-compile QtMultimedia for Pi? Could you show please? I'm a beginner:)

Log in to reply