This is all work and my problem----->
[root@localhost mycpp]# ls
hello.cpp
[root@localhost mycpp]# grep -qa|grep qt
Usage: grep [OPTION]... PATTERN [FILE]...
Try `grep --help' for more information.
[root@localhost mycpp]# rpm -qa|grep qt
qtcups-2.0-15
qt-3.1.1-6
[root@localhost mycpp]# cat hello.cpp
#include <qapplication.h>
#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30);
a.setMainWidget( &hello);
hello.show();
return a.exec();
}
[root@localhost mycpp]# g++ hello.cpp
hello.cpp:1:26: qapplication.h: No such file or directory
hello.cpp:2:25: qpushbutton.h: No such file or directory
hello.cpp: In function `int main(int, char**)':
hello.cpp:6: `QApplication' undeclared (first use this function)
hello.cpp:6: (Each undeclared identifier is reported only once for each
function it appears in.)
hello.cpp:6: parse error before `(' token
hello.cpp:7: `QPushButton' undeclared (first use this function)
hello.cpp:8: `hello' undeclared (first use this function)
hello.cpp:9: `a' undeclared (first use this function)
[root@localhost mycpp]#
Did I make something wrong?
How to compile hello.cpp and to execute it?