我在LINUX系统下装了QT3,我编译了个简单的程序:
#include <qapplication.h>
#include <qwidget.h>
#include <qpushbutton.h>
int main(int argc,char **argv)
{
QApplication a( argc,argv );
QWidget mainwindow;
mainwindow.setMinimumSize( 200,100 );
mainwindow.setMaximumSize( 200,100 );
QPushButton helloworld( "hello world!",&mainwoindow );
helloworld.SetGeometry( 20,20,160,60 );
a.setMainWidget( &mainwindow );
mainwindow.show();
return a.exec();
}
但是出现如下的错误:
world.cpp:1:26: error: qapplication.h: No such file or directory
world.cpp:2:21: error: qwidget.h: No such file or directory
world.cpp:3:25: error: qpushbutton.h: No such file or directory
world.cpp: In function ‘int main(int, char**)’:
world.cpp:9: error: ‘QApplication’ was not declared in this scope
world.cpp:9: error: expected `;' before ‘a’
world.cpp:10: error: ‘QWidget’ was not declared in this scope
world.cpp:10: error: expected `;' before ‘mainwindow’
world.cpp:11: error: ‘mainwindow’ was not declared in this scope
world.cpp:14: error: ‘QPushButton’ was not declared in this scope
world.cpp:14: error: expected `;' before ‘helloworld’
world.cpp:15: error: ‘helloworld’ was not declared in this scope
world.cpp:17: error: ‘a’ was not declared in this scope
我在想是不是什么函数库没有装上?