标题:【提问】`QApplication' undeclared (first use this function)//我有设环境变量啊!在线等!
作者:xtwxfxk
日期:2006-03-11 05:29
内容:
#include
#include
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QPushButton hello("Hello world!");
hello.resize(100, 30);
hello.show();
return app.exec();
}
这段代码在 QApplication app(argc, argv); 也就是第6行啊!
我在Devcpp里运行出现这种错误啊 expected `;' before "app" 我不明白那里错了啊!
谁帮我一下啊!
#1 [xtwxfxk 03-11 05:33]
错了!是这个错误啊!`QApplication' undeclared (first use this function)
是不是没有引入那个包啊!是那个啊!谁和我说一下啊!!
帮帮忙啊!!!!
#2 Re:【提问】`QApplication' undeclared (first use t [XChinux 03-11 06:09]
你环境变量没有设置。
QTDIR没有设置
#3 [xtwxfxk 03-11 06:10]
不是吧!!
我看看!先谢过!
#4 [xtwxfxk 03-11 06:12]
我有啊!
QTDIR D:\SOFT\Qt
是不是这样啊!
我有设啊!
#5 Re:【提问】`QApplication' undeclared (first use t [XChinux 03-12 03:16]
你的开发环境已经正确搭建起来了没有?
第二是你是怎么样编译的?是打开 DOS窗口来进行编译的?
在开始菜单的 Qt程序组里,有Qt Command Prompt来供你使用(不要使用DOS控制台)