missing ';' before 'namesapce'错误的解决
来源:互联网 发布:matlab excel数据画图 编辑:程序博客网 时间:2024/06/10 08:57
作者:朱金灿
来源:http://blog.csdn.net/clever101
上午开发时出现一个编译错误:missing ';' before 'namesapce',我仔细检查了出错的那句代码,感觉任何没有问题。删掉再重新输入也依然出现这个问题。上网查了下资料,找到了答案:
This can happenwhen one include file has an error (or missing semicolon) at the end of thefile and that file is included immediately before another. The error that isgenerated indicates that there is a problem in the second include file ratherthan the first. So as a starting point, make sure that, if you have a filethat's included before Time.h, that is doesn't have any errors in it.
Pasting thecontent of your .h and .cpp files would certainly be helpful rather than justthe error message.
上面是说某个包含的头文件有一个错误(可能是缺少一个分号)。看到这里,我想到刚刚新建的一个类的头文件声明是不是缺少分号呢?一去检查,发现果然缺少分号。该错误的诡异之处在于编译器并不把错误提示在缺少分号的那个头文件,而是其它头文件,结果就是导致了让人找了很久也百思不得其解。我的编译环境是VS 2005+sp1, Win XP + sp3。
参考文献:
1. ErrorC2143 (missing ; before namespace) in MS VC include
- missing ';' before 'namesapce'错误的解决
- missing ';' before 'namesapce'错误的解决
- missing ';' before identifier 'NDIS_OID'错误的解决办法
- 使用sndPlaySound时的错误syntax error : missing ';' before identifier 'MMVERSION'的解决
- 关于错误 syntax error : missing ';' before 'type' 的分析
- 解决VC中出现 " missing ')' before 'constant'"错误
- 调用航班查询接口,用jsonp跨域时出现SyntaxError: missing ; before statement错误解决记录
- syntax error : missing ';' before 'type'错误
- syntax error : missing ';' before 'type'错误
- VS2005错误 missing ';' before identifier 'PVOID64
- 编译错误syntax error : missing ';' before 'type'
- 编译错误syntax error : missing ';' before 'type'
- 编译错误syntax error : missing ';' before 'type'
- 编译错误syntax error : missing ';' before 'type'
- error C2143: syntax error : missing ';' before '*.... 解决...
- missing template arguments before异常解决
- git error Missing blob 错误的解决
- VC中出现error C2143: syntax error : missing ';' before '*'错误的解决方案
- db2备份还原数据库
- 中国移动互联网低端应用要开始泛滥啦,大家做好防洪准备...
- IE6下PNG图片透明解决办法
- 类中的常量(高质量C++编程指南--5.4 摘录)
- (牛文)(译)在cocos2d里面如何使用Texture Packer和像素格式来优化spritesheet
- missing ';' before 'namesapce'错误的解决
- 如何使用Windbg调试User Mode代码
- AIX 上的配置 Samba
- 真难过
- 真实的美国教育:轻松背后的繁重 真诚背后的虚伪
- DOM4J 创建 XML
- 关于numeric_limits
- Busybox文件系统交叉编译
- jQuery获取Select选择的Text和 Value(转)