[问题]新立得里面的QT4是怎么装的?帮我一下阿libqt4-core qt4-designer qt4-dev-t

软件和网站开发以及相关技术探讨
回复
头像
wth123456
帖子: 234
注册时间: 2006-12-07 17:32

[问题]新立得里面的QT4是怎么装的?帮我一下阿libqt4-core qt4-designer qt4-dev-t

#1

帖子 wth123456 » 2007-02-10 14:23

我在新立得里面安装了下面几个包
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
前两步都没有问题,但是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’
glocklee
帖子: 53
注册时间: 2006-10-21 8:05

#2

帖子 glocklee » 2007-02-11 14:47

我怎么觉得应该用G++而不是GCC呢

大概就是这个原因造成那几个宏不能处理吧
gothicane
帖子: 157
注册时间: 2006-08-29 10:31

#3

帖子 gothicane » 2007-02-13 22:48

还是从QT官网上下源码自己编译吧
头像
wth123456
帖子: 234
注册时间: 2006-12-07 17:32

#4

帖子 wth123456 » 2007-02-18 14:42

glocklee 写了:我怎么觉得应该用G++而不是GCC呢

大概就是这个原因造成那几个宏不能处理吧
我觉得也应该用G++ 但是Makefile是qmake自动生成的,在windows下面也是这样用的.
头像
wth123456
帖子: 234
注册时间: 2006-12-07 17:32

#5

帖子 wth123456 » 2007-02-18 14:43

gothicane 写了:还是从QT官网上下源码自己编译吧
我怕麻烦.最好用新立得里面的.
fallening
帖子: 131
注册时间: 2006-10-30 19:54
来自: Hannover

#6

帖子 fallening » 2007-11-10 14:22

qmake-qt4
回复