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. [SOLVED] Netbeans 7.3.1 & Phonon
QtWS25 Last Chance

[SOLVED] Netbeans 7.3.1 & Phonon

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 1.5k Views
  • 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
    Raphyy
    wrote on last edited by
    #1

    Hi,

    I'm trying to compile the following code :
    @QUrl urlVideo = QString("C:\Users\Doe\Desktop\Aaaah.mp4");
    Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);
    player->play(urlVideo);@

    But i got this error :

    bq. c:/Qt/4.8.4/lib/libqtmaind.a(qtmain_win.o): In function WinMain@16': c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:131: undefined reference to qMain(int, char**)'

    Do you know how to fix this ?

    Thanks.

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

      Hi,

      Is it the complete code ? Or do you have it in a main.cpp ?

      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
      • R Offline
        R Offline
        Raphyy
        wrote on last edited by
        #3

        No this is not the complete code : before adding this in my current project I do some test in a separate test project.
        Here is the main :

        @#include <QtGui/QApplication>
        #include <QUrl>
        #include <Phonon/VideoPlayer>

        int main()
        {
        QUrl urlVideo = QString("C:\Users\Raphy\Desktop\Aaaah.mp4");
        Phonon::VideoPlayer *player = new Phonon::VideoPlayer(Phonon::VideoCategory, 0);
        player->play(urlVideo);

        return 0;
        

        }
        @

        Thanks for your help !

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

          You are missing a QApplication and creating a memory leak with player not delete before the program returns

          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
          • R Offline
            R Offline
            Raphyy
            wrote on last edited by
            #5

            I found the solution, I created a proper main :

            @#include <QtGui/QApplication>
            #include "newForm.h"

            int main(int argc, char *argv[])
            {
            QApplication app(argc, argv);
            newForm form;
            form.show();
            return app.exec();
            }@

            ... and a form containing my Phonon Video Player.

            The most important part using Netbeans, add :

            bq. "QT += phonon"

            in the project properties :

            bq. Build -> Qt -> Custom Definitions

            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