我装的qt版本是Qt Creator2.0
按教程在打开qt后选择Qt Console Application建一个hellotext 的工程后
输入以下代码:
#include <QtCore/QCoreApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
QLabel*label=new QLabel("hello would");
label->show();
return a.exec();
}
保存后运行时出现图中的提示
错误:'QLabel'在此作用域中尚未声明
错误:'label'在此作用域中尚未声明
错误:expected type-specifier befor 'QLabel'
错我:expected ';' befoe 'Qlabel'
请教原因和正确代码