phonon::Mediaobject
-
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
-
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
@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?