|
- #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@buffee ~]# qmake -project /root/qt_program/main.cpp
[root@buffee ~]# qmake /root/qt_program/main.cpp
/root/qt_program/main.cpp:5: Unknown test function: int main
/root/qt_program/main.cpp:7: Unknown test function: QApplication a
/root/qt_program/main.cpp:7: Parse Error ('QApplication a( argc, argv );')
/root/qt_program/main.cpp:7: Unterminated conditional block at end of file
Error processing project file: /root/qt_program/main.cpp
不知道什么原因
ps:
qmake等命令必须到Qt-4.2.2的安装目录下才能执行,可能是./configure的时候没有
设置environment variables |
|