libqt4-core
qt4-designer
qt4-dev-tools
qt4-qtconfig
libqt4-dev
libqt4-gui libqt4-debug
libqt4-sql
可是在编译的时候通不过。
我的程序是QT4的
代码: 全选
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello QT!");
label->show();
return app.exec();
}
代码: 全选
qmake -project
qmake
make
代码: 全选
wth@wth-desktop:~/test/qt$ make
gcc -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -I. -o qthello.o qthello.c
In file included from /usr/include/qt4/QtCore/qobjectdefs.h:27,
from /usr/include/qt4/QtCore/qobject.h:29,
from /usr/include/qt4/QtCore/qcoreapplication.h:27,
from /usr/include/qt4/QtGui/qapplication.h:27,
from /usr/include/qt4/QtGui/QApplication:1,
from qthello.c:1:
/usr/include/qt4/QtCore/qnamespace.h:31: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QT_MODULE’
/usr/include/qt4/QtCore/qnamespace.h:1365: error: expected ‘)’ before ‘:’ token
/usr/include/qt4/QtCore/qnamespace.h:1381: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Q_CORE_EXPORT’
In file included from /usr/include/qt4/QtCore/qobject.h:29,
from /usr/include/qt4/QtCore/qcoreapplication.h:27,
from /usr/include/qt4/QtGui/qapplication.h:27,
from /usr/include/qt4/QtGui/QApplication:1,
from qthello.c:1:
/usr/include/qt4/QtCore/qobjectdefs.h:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QT_BEGIN_HEADER’
/usr/include/qt4/QtCore/qobjectdefs.h:35: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QByteArray’
/usr/include/qt4/QtCore/qobjectdefs.h:164: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QObject’
/usr/include/qt4/QtCore/qobjectdefs.h:165: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QMetaMethod’
/usr/include/qt4/QtCore/qobjectdefs.h:166: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘QMetaEnum’