Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt Gui for multimedia with qt5 not recognizing the multimedia library
Forum Updated to NodeBB v4.3 + New Features

Qt Gui for multimedia with qt5 not recognizing the multimedia library

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    reemAshour
    wrote on last edited by
    #1

    Hello,

    I am new in using qt for gui, I am trying to creat a project that shows a video in the main page, i followed the tutorial in http://qt-project.org/doc/qt-4.8/multimedia-videowidget.html

    I got the following error:

    DQT_MULTIMEDIA_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I../VideoWidgetSurface -I/usr/include/qt5 -I/usr/include/qt5/QtMultimedia -I/usr/include/qt5/QtNetwork -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -I. -I. -o main.o ../VideoWidgetSurface/main.cpp
    In file included from ../VideoWidgetSurface/main.cpp:2:0:
    ../VideoWidgetSurface/videoplayer.h:45:25: fatal error: QTGui/QWidget: No such file or directory
    #include <QTGui/QWidget>
    ^
    compilation terminated.
    make: *** [main.o] Error 1
    15:47:55: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project VideoWidgetSurface (kit: Desktop)
    When executing step 'Make'
    15:47:55: Elapsed time: 00:00.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      You're following a Qt 4 tutorial using Qt 5. You should rather follow the latest documentation.

      QWidget and friends have moved to their own module name widgets and the include path would be QtWidgets/QWidget. Anyway better just use

      @#include <QWidget>@

      You should also add

      @QT += widgets@

      to your pro file

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • ZlatomirZ Offline
        ZlatomirZ Offline
        Zlatomir
        wrote on last edited by
        #3

        Actually it doesn't link the widgets library, not multimedia, QWidget is in widgets module in Qt5, so you'll need to add:
        @QT += widgets@
        in your .pro file, run qmake and then rebuild.

        LE: too late, there was a feature that warns you when you post and someone already posted on that topic, that doesn't work anymore or i don't remember correctly?

        Anyway, in Qt5 there is a "MultimediaWidgets":http://doc.qt.io/qt-5/qtmultimediawidgets-index.html module that already has a "video-widget":http://doc.qt.io/qt-5/qvideowidget.html.

        https://forum.qt.io/category/41/romanian

        1 Reply Last reply
        0
        • R Offline
          R Offline
          reemAshour
          wrote on last edited by
          #4

          @zlatomir and @SGaist Thank you both. I tryed but I got errors and as I mentioned am a biggener where I dont really understand the errors. Therefore, I created new project with the latest documentation for qt5 from the following link: http://doc.qt.io/qt-5/qtmultimediawidgets-videowidget-example.html

          and I got the following error:

          16:45:03: Running steps for project videowidget...
          16:45:03: Starting: "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" /home/reem/videowidget/videowidget.pro -r -spec linux-g++-64 CONFIG+=debug
          Project ERROR: Unknown module(s) in QT: multimediawidgets multimedia
          16:45:03: The process "/usr/lib/x86_64-linux-gnu/qt5/bin/qmake" exited with code 3.
          Error while building/deploying project videowidget (kit: Desktop)
          When executing step 'qmake'
          16:45:03: Elapsed time: 00:00.

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Since it looks like you are using your distribution's Qt, did you check that you have all Qt 5 dev packages installed ?

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved