error C2065: “IDD_DIALOG1”: 未声明的标识符 .
2012-08-27 10:03
309 查看
在VC 中编译工程时候,经常会出现 error C2065: “IDD_DIALOG1”: 未声明的标识符的错误。(⊙o⊙)…,明明定义了却说没定义。
有时候还可能会出现一大堆
error C2065: “IDD_DIALOG1”:
error C2065: “IDD_DIALOG2”:
error C2065: “IDD_DIALOG3”:
error C2065: “IDD_DIALOG4”:
error:……………………………
烦人啦,明明定义了,resources.h文件都可以找到。这是神马原因呢?
网上一些解决方法这里就不说了,有另一种情况,分析下:
可能你在工程里面定义了一个新类:如CAuthority 这个类不是从MFC框架中派生而来,是一个完全独立的一个新类(它有头文件:Authority.h 和实现文件:Authority.cpp)。
然后问题就可能出现了,你可能在这个新类中需要用到 IDD_DIALOG1关联的那个类 ,这里叫做 CMyDilalog (它有头文件:MyDialog.h 和实现文件:MyDialog.cpp)
Authority.cpp 的头文件包含如下:
[cpp]
view plaincopyprint?
#include "stdafx.h"
#include "Authority.h"
#include "MyDialog.h"
error C2065: “IDD_DIALOG1”:
这里发生错误的原因是没有把工程文件的头文件包含进去。
如果工程名为:xxx
则应该改为如下:
[cpp]
view plaincopyprint?
#include "stdafx.h"
#include "xxx.h"
#include "Authority.h"
#include "MyDialog.h"
现在编译就通过了。
具体原因我也不太清楚,哪位大神可以告诉我……
有时候还可能会出现一大堆
error C2065: “IDD_DIALOG1”:
error C2065: “IDD_DIALOG2”:
error C2065: “IDD_DIALOG3”:
error C2065: “IDD_DIALOG4”:
error:……………………………
烦人啦,明明定义了,resources.h文件都可以找到。这是神马原因呢?
网上一些解决方法这里就不说了,有另一种情况,分析下:
可能你在工程里面定义了一个新类:如CAuthority 这个类不是从MFC框架中派生而来,是一个完全独立的一个新类(它有头文件:Authority.h 和实现文件:Authority.cpp)。
然后问题就可能出现了,你可能在这个新类中需要用到 IDD_DIALOG1关联的那个类 ,这里叫做 CMyDilalog (它有头文件:MyDialog.h 和实现文件:MyDialog.cpp)
Authority.cpp 的头文件包含如下:
[cpp]
view plaincopyprint?
#include "stdafx.h"
#include "Authority.h"
#include "MyDialog.h"
#include "stdafx.h" #include "Authority.h" #include "MyDialog.h"问题就出现了,错误如下:
error C2065: “IDD_DIALOG1”:
这里发生错误的原因是没有把工程文件的头文件包含进去。
如果工程名为:xxx
则应该改为如下:
[cpp]
view plaincopyprint?
#include "stdafx.h"
#include "xxx.h"
#include "Authority.h"
#include "MyDialog.h"
#include "stdafx.h" #include "xxx.h" #include "Authority.h" #include "MyDialog.h"
现在编译就通过了。
具体原因我也不太清楚,哪位大神可以告诉我……
相关文章推荐
- error C2065: “IDD_DIALOG1”: 未声明的标识符 .
- error C2065: “IDD_DIALOG1”: 未声明的标识符
- error C2065: “IDD_DIALOG1”: 未声明的标识符
- error C2065: “IDD_DIALOG1”: 未声明的标识符
- error C2065: “IDD_DIALOG1”: 未声明的标识符
- error C2065: “IDD_DIALOG1”: 未声明的标识符
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- MFC error C2065: “IDD_DIALOG1” : 未声明的标识符 转载
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- error C2065: “IDD_DIALOG”: 未声明的标识符
- error C2065: “IDD_REGDLG”: 未声明的标识符
- error C2065: “IDD_DIALOG1” : 未声明的标识符
- 错误 1 error C2065: “IDC_LISTBOX”: 未声明的标识符
- "\include\qwt\qwt_math.h(105): error C2065: “M_PI_2”: 未声明的标识符"
- error C2065: “Graphics”: 未声明的标识符
- error C2065:未声明的标识符错误
- 未声明的标识符ERROR C2065