0
我的Ubuntu上运行64位的13.10安装的Qt Creator还我已经安装了libphonon-dev的Qt的C++图形用户界面的桌面应用程序的声子
我的代码看起来是这样的: mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <phonon/phonon> // yes directory /usr/include/phonon exists
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
Phonon::MediaObject *music = Phonon::createPlayer(Phonon::MusicCategory, Phonon::MediaSource("/home/erik/Downloads/Bob_Marley-No_Woman_No_Cry.mp3"));
music->play();
}
MainWindow::~MainWindow()
{
delete ui;
}
我获得10个同样的错误:
/usr/include/phonon/phonon:12: In file included from
/usr/include/phonon/phonon:12:0,
/home/erik/QtProjs/QtPlayer/mainwindow.cpp:3: from
../QtPlayer/mainwindow.cpp:3: /usr/include/phonon/effectwidget.h:28:
error: QtGui/QWidget: No such file or directory #include
<QtGui/QWidget>^/usr/include/phonon/effectwidget.h
任何其他项目文件是默认(mainwindow.h,mainwindow.ui,main.cpp中)
昨天我做了一个简单的文本编辑器(而不是例子),但我不能通过这个错误。
Thankyou