我现在用的是VC++2008EE和QT4.4.0,想编译最简单的Hello程序,但是没法编译成功。
报错信息是
------ Build started: Project: hello, Configuration: Debug Win32 ------
Compiling...
hello.cpp
e:\cpp.projects\hello\hello\hello.cpp(1) : fatal error C1083: Cannot open include file: 'qapplication.h': No such file or directory
Build log was saved at "file://e:\cpp.projects\hello\hello\Debug\BuildLog.htm"
hello - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
系统参数是
QMAKESPEC: win32-msvc2008
QTDIR: c:\Qt\4.4.0\
在configure成功之后,就开始在VC里面写程序了,可是就把hello这个程序拷进去之后,然后编译和运行,就出现了上面的错误了。
VC里面需要添加的lib,include,bin文件都加了。我在其他论坛地方看到,有可能是因为处理器是AMD的问题,但是还是比较疑惑,总觉得不可能处理器不是intel的就不能编译,想问问有什么办法可以在自己电脑上面编译。如何解决这个问题,已经花了几天在这个安装和配置问题上了,一直解决不了。
hello.cpp
#include <QApplication>
#include <QLabel>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}