博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
missing ';' before 'namesapce'错误的解决
阅读量:7227 次
发布时间:2019-06-29

本文共 849 字,大约阅读时间需要 2 分钟。

作者:朱金灿

来源:

 

       上午开发时出现一个编译错误: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.

转载于:https://www.cnblogs.com/lanzhi/archive/2012/03/01/6470844.html

你可能感兴趣的文章
细谈Spring(一)spring简介
查看>>
网络工程师的面试题
查看>>
nginx启动脚本
查看>>
常用输入法框架简介
查看>>
记录新机房建设。20130629
查看>>
安装ntop
查看>>
ssh远程登录讲解
查看>>
mysql的备份脚本
查看>>
linux下mysql的root密码忘记解决方法
查看>>
7.索引的性能分析
查看>>
在 Delphi 下使用 DirectSound (17): 频率均衡效果器 IDirectSoundFXParamEq8
查看>>
文件操作命令一cp 2
查看>>
Multi-Mechanize工程目录结构说明
查看>>
halt
查看>>
标准ACL+扩展ACL+命名ACL
查看>>
Meteor应用的启动过程分析
查看>>
九曲黄河万里沙,浪淘风簸自天涯 — 正则表达式
查看>>
欲哭无泪,联想笔记本性价比
查看>>
很简单的在Ubuntu系统下安装字体和切换默认字体的方法
查看>>
我的友情链接
查看>>