is not a class or namespace name
来源:互联网 发布:淘宝客 api sdk 编辑:程序博客网 时间:2024/05/29 19:43
is not a class or namespace name解决方法
我在mfc编程里,头文件里声明了个类,然后在源文件里实现类里的函数,结果一堆错误:xxx is not a class or namespace name。
每建立一个新类,都要在classname.cpp文件中加入#include "stdafx.h"文件,而且加的位置要在第一行。原因:编译器通过一个头文件stdafx.h来使用预编译头文件,所谓头文件预编译,就是把一个工程(Project)中使用的一些MFC 标准头文件(如Windows.H、Afxwin.H)预先编译,以后该工程编译时,不再编译这部分头文件,仅仅使用预编译的结果。这样可以加快编译速度,节省时间。 预编译头文件通过编译stdafx.cpp 生成,以工程名命名,由于预编译的头文件的后缀是“pch”,所以编译结果文件是projectname.pch。编译器通过一个头文件stdafx.h 来使用预编译头文件。stdafx.h 这个头文件名是可以在project 的编译设置里指定的。编译器认为,所有在指令#include "stdafx.h"前的代码都是预编译的,它跳过#includestdafx. h"指令,使用projectname.pch 编译这条指令之后的所有代码。 因此,所有的CPP 实现文件第一条语句都是:#include "stdafx.h"。- is not a class or namespace name
- is not a class or namespace name
- is not a class or namespace name解决方法
- std' : is not a class or namespace name,解决
- error C2653: 'QMessageBox' : is not a class or namespace name
- is not a class or namespace name解决方法
- is not a class or namespace name解决方法
- 【VC】编译出错is not a class or namespace name的解决办法
- 编译错误提示:GetWeb.cpp(99) : error C2653: 'CWebPage' : is not a class or namespace name
- 出现类似'CListView' : is not a class or namespace name的原因及解决方法
- My enum is not a class or namespace
- error: not a class or struct name
- The type or namespace name 'Windows' does not exist in the class or namespace 'System'
- 没有躲过的坑--头文件相互包含(Compiler error C2653: not a class or namespace name)
- 警告: Could not find action or result There is no Action mapped for namespace [/] and action name [] a
- Could not find action or result:There is no Action mapped for namespace / and action name
- 关于error C2871: 'std' : does not exist or is not a namespace处理
- 关于VC中 error C2871: 'std' : does not exist or is not a namespace
- matlab实现gabor filter 多种方式汇总
- 使用VMware让ubuntu10.4和win7文件共享
- linux设备驱动归纳总结(三):5.阻塞型IO实现
- linux设备驱动归纳总结(三):6.poll和sellct
- HDU 1002 A + B Problem II
- is not a class or namespace name
- inf详细分析
- linux设备驱动归纳总结(三):7.异步通知fasync
- index 优缺点
- 关于Mysql的锁(一)
- 五十道编程题目01 兔子的出生
- HDU 1042 N!
- 子查询
- 【树状数组】 poj2352 Stars