• 3462阅读
  • 2回复

头文件报错,请大家帮忙看看。 [复制链接]

上一主题 下一主题
离线wxjeacen
 

只看楼主 倒序阅读 楼主  发表于: 2009-03-13
  1. #ifndef _LOGINDLG_H_
  2. #define _LOGINDLG_H_
  3. #include <QtGui/QDialog>
  4. class CLoginDlg :public QDialog
  5. {
  6.       Q_OBJECT
  7.       public :
  8.     CLoginDlg(QWidget* =0);
  9.       public slots:
  10.         virtual void accept();
  11.       private:
  12.     QLineEdit* usrLineEdit;
  13.     QLineEdit* pwdLineEdit;
  14. };
  15. #endif

这是我的一个头文件
编译的时候报错。
In file included from moc_logindlg.cpp:10:
logindlg.h:12: error: ISO C++ forbids declaration of ‘QLineEdit’ with no type
logindlg.h:12: error: expected ‘;’ before ‘*’ token
logindlg.h:13: error: ISO C++ forbids declaration of ‘QLineEdit’ with no type
logindlg.h:13: error: expected ‘;’ before ‘*’ token
make: *** [moc_logindlg.o] Error 1


各位高人帮看看怎么解决。
生命不熄,战斗不止。
离线lugaideath

只看该作者 1楼 发表于: 2009-03-13
晕!没有引入QLineEdit的头文件啊!
把#include <QtGui/QDialog>换成#include <QtGui>就好了
离线wxjeacen

只看该作者 2楼 发表于: 2009-03-13
thank you ,

it works
生命不熄,战斗不止。
快速回复
限100 字节
 
上一个 下一个