• 6274阅读
  • 4回复

求助!编译dev-c++ QT时出现错误! [复制链接]

上一主题 下一主题
离线matay
 
只看楼主 倒序阅读 楼主  发表于: 2009-01-28
— 本帖被 XChinux 执行加亮操作(2009-01-29) —
我是个初学者,刚开始接触QT,我的开发环境是dev-C++..
第一次写helloworld程序就出现了如下错误!不知道怎么解决?请高手们指点!谢谢!

1 C:\Dev-Cpp\projects\main.cpp Qt3Support: No such file or directory.
2 C:\Dev-Cpp\projects\main.cpp QApplication: No such file or directory.
3 C:\Dev-Cpp\projects\main.cpp QLabel: No such file or directory.
C:\Dev-Cpp\projects\main.cpp In function `int main(int, char**)':
7 C:\Dev-Cpp\projects\main.cpp `QApplication' undeclared (first use this function)
  (Each undeclared identifier is reported only once for each  function it appears in.)
8 C:\Dev-Cpp\projects\main.cpp `QLabel' undeclared (first use this function)
8 C:\Dev-Cpp\projects\main.cpp `label' undeclared (first use this function)
8 C:\Dev-Cpp\projects\main.cpp syntax error before `(' token
9 C:\Dev-Cpp\projects\main.cpp `app' undeclared (first use this function)
C:\Dev-Cpp\projects\Makefile.win [Build Error]  [main.o] Error 1
离线matay
只看该作者 1楼 发表于: 2009-01-28
HellowWorld程序如下!

#include <Qt3Support>
#include <QApplication>
#include <QLabel>

int main(int argc, char *argv[])
{
    QApplication app (argc, argv);
    QLabel *label = new QLabel("Hello Qt!", 0);
    app.setMainWidget(label);
    label->show();
    return app.exec();
}
只看该作者 2楼 发表于: 2009-01-28
不要用dev-cpp的编译命令,自己在命令行里qmake之后make
离线wd007

只看该作者 3楼 发表于: 2009-01-31
你的环境变量等的设置有可能不太对
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
离线xtss
只看该作者 4楼 发表于: 2010-01-07
工程属性里面添加lib以及include的路径
快速回复
限100 字节
 
上一个 下一个