qt_main.cpp:1:24: error: QApplication: No such file or directory
qt_main.cpp:2:23: error: QPushButton: No such file or directory
qt_main.cpp:13:3: warning: no newline at end of file
qt_main.cpp: In function ‘int main(int, char**)’:
qt_main.cpp:6: 错误: ‘QApplication’ 在此作用域中尚未声明
qt_main.cpp:6: 错误: expected `;' before ‘app’
qt_main.cpp:8: 错误: ‘QPushButton’ 在此作用域中尚未声明
qt_main.cpp:8: 错误: expected `;' before ‘hello’
qt_main.cpp:9: 错误: ‘hello’ 在此作用域中尚未声明
qt_main.cpp:12: 错误: ‘app’ 在此作用域中尚未声明
qt_main.cpp: At global scope:
qt_main.cpp:4: 警告: 未使用的形参 ‘argc’
qt_main.cpp:4: 警告: 未使用的形参 ‘argv’
make: *** [qt_main.o] 错误 1
#include <QApplication>
#include <QPushButton>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
[ 此贴被XChinux在2006-08-30 08:42重新编辑 ]