Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. phonon::Mediaobject
Forum Updated to NodeBB v4.3 + New Features

phonon::Mediaobject

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 182 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.
  • P Offline
    P Offline
    praveen_1323
    wrote on last edited by
    #1

    here i am using ubuntu 20.04 and qt 4. i want to add a mp4 video to a widget but it shows undefined reference as error . i also added QT+=phonon in ( .pro ) file.

    My code:

    videoplayer = new phonon::VideoPlayer(Phonon::VideoCategory,this);
    

    layout->addWidget(videoplayer);
    layout->addWidget(ui->pushButton);

    setLayout(layout);

    void Widget::on_pushButton_clicked()
    {
    videoplayer->load(Phonon::MediaSource("/home/praveen/praveen/documents/video3.mp4"));
    videoplayer->play();
    }

    ERROR::
    video/widget.cpp:-1: error: undefined reference to `Phonon::VideoPlayer::VideoPlayer(Phonon::Category, QWidget*)'

    /video/widget.cpp:-1: error: undefined reference to `Phonon::MediaSource::MediaSource(QString const&)'

    :-1: error: collect2: ld returned 1 exit status

    jsulmJ 1 Reply Last reply
    0
    • P praveen_1323

      here i am using ubuntu 20.04 and qt 4. i want to add a mp4 video to a widget but it shows undefined reference as error . i also added QT+=phonon in ( .pro ) file.

      My code:

      videoplayer = new phonon::VideoPlayer(Phonon::VideoCategory,this);
      

      layout->addWidget(videoplayer);
      layout->addWidget(ui->pushButton);

      setLayout(layout);

      void Widget::on_pushButton_clicked()
      {
      videoplayer->load(Phonon::MediaSource("/home/praveen/praveen/documents/video3.mp4"));
      videoplayer->play();
      }

      ERROR::
      video/widget.cpp:-1: error: undefined reference to `Phonon::VideoPlayer::VideoPlayer(Phonon::Category, QWidget*)'

      /video/widget.cpp:-1: error: undefined reference to `Phonon::MediaSource::MediaSource(QString const&)'

      :-1: error: collect2: ld returned 1 exit status

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @praveen_1323 said in phonon::Mediaobject:

      video/widget.cpp:-1: error: undefined reference to `Phonon::VideoPlayer::VideoPlayer(Phonon::Category, QWidget*)'

      You're apparently not linking the library containing VideoPlayer.
      Please post the linker call and also check the compiler output for any messages like unsupported library.
      Why do you use Qt4?

      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