• 7192阅读
  • 1回复

<QApplication> & <QPopupMenu> 无法编译 [复制链接]

上一主题 下一主题
离线xiaojita
 

只看楼主 倒序阅读 楼主  发表于: 2008-07-11
— 本帖被 XChinux 执行加亮操作(2008-07-11) —
  Dijkstra ShortPathAlgorithm.rar (23 K) 下载次数:2 刚刚装好环境 VC 2008 EE Qt4.4.0, 第一次试车成功,Hello程序可以跑
#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();
}

可是再继续编我一个大的程序时候又不认了,是怎么回事呢?我把程序加载上来了,可以试试。请达人指教!



------ Build started: Project: ShortPathAlgorithm, Configuration: Debug Win32 ------
Compiling...
main.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\main.cpp(1) : fatal error C1083: Cannot open include file: 'QApplication': No such file or directory
moc_popUp.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\popup.h(8) : fatal error C1083: Cannot open include file: 'QPopupMenu': No such file or directory
moc_shortPath.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\shortpath.h(7) : fatal error C1083: Cannot open include file: 'QPopupMenu': No such file or directory
popUp.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\popup.cpp(5) : fatal error C1083: Cannot open include file: 'QPopupMenu': No such file or directory
shortPath.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\shortpath.cpp(9) : fatal error C1083: Cannot open include file: 'QApplication': No such file or directory
Generating Code...
Build log was saved at "file://e:\cpp.projects\ShortPathAlgorithm\ShortPathAlgorithm\Debug\BuildLog.htm"
ShortPathAlgorithm - 5 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
离线xiaojita

只看该作者 1楼 发表于: 2008-07-11
#include <QtGui/QApplication>
#include <QtGui/QColor>
#include <QtCore/QString>


之后暂且没有问题了,但是在statement里面,又报错说

Compiling...
main.cpp
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\main.cpp(26) : error C2039: 'setMainWidget' : is not a member of 'QApplication'
        c:\qt\4.4.0\src\gui\kernel\qapplication.h(89) : see declaration of 'QApplication'
e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\main.cpp(29) : error C2039: 'setBackgroundColor' : is not a member of 'Main'
        e:\cpp.projects\shortpathalgorithm\shortpathalgorithm\shortpath.h(27) : see declaration of 'Main'
Build log was saved at "file://e:\cpp.projects\ShortPathAlgorithm\ShortPathAlgorithm\Debug\BuildLog.htm"
ShortPathAlgorithm - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

我查过了,在QAppliaction底下,明明有setMainWidget 还有其他一些方法,为什么到这里就不认了呢?
快速回复
限100 字节
 
上一个 下一个