ich wollte jetzt mal ein bisschen mit phonon arbeiten und so zum Test wollte ich einfach mal ein Programm schreiben das einfach ein Lied abspielt.
Leicht gesagt - schwer getan. Es ist zum verrückt werden
Ich hab keine Ahnung, ob ich phonon richtig installiert habe, aber es sollte bei Qt doch eigentlich dabei sein. Erstmal mein Code:
Code: Alles auswählen
#include <phonon/audiooutput.h>
#include <phonon/path.h>
#include <phonon/mediaobject.h>
#include <QCoreApplication>
int main(int argc, char** argv)
{
QCoreApplication app(argc, argv);
app.setApplicationName("test");
Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory,
Phonon::MediaSource(argv[1]));
music->play();
return app.exec();
}
jetzt noch die .pro-Datei
Code: Alles auswählen
TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += .
Qt += phonon
# Input
SOURCES += test.cpp
Code: Alles auswählen
test.cpp:(.text+0x22): undefined reference to `Phonon::MediaSource::MediaSource(QString const&)'
test.cpp:(.text+0x2f): undefined reference to `Phonon::createPlayer(Phonon::Category, Phonon::MediaSource const&)'
test.cpp:(.text+0x3a): undefined reference to `Phonon::MediaSource::~MediaSource()'
test.cpp:(.text+0x5b): undefined reference to `Phonon::MediaObject::play()'
test.cpp:(.text+0x6f): undefined reference to `Phonon::MediaSource::~MediaSource()'
collect2: ld gab 1 als Ende-Status zurück
MfG energetic