作者:朱金灿

来源: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

作者:clever101 发表于2012-3-1 18:11:03 原文链接
阅读:46 评论:0 查看评论

[原]missing #39;;#39; before #39;namesapce#39;错误的解决相关推荐

  1. 关于PyCharm编程中报出ImportError: Missing optional dependency ‘openpyxl‘. Use pip or conda to ins错误的解决办法

     关于PyCharm编程中报出ImportError: Missing optional dependency 'openpyxl'. Use pip or conda to ins错误的解决办法之一 ...

  2. linux内核版本 2.6.39,编译RedHat Linux-2.6.39内核

    1.  准备编译环境 1)RedHat Server 5.1 Linux 2.6.18-53.el5: 2)linux-2.6.39.tar.bz2源代码 2.工作目录 #cd /usr/src/ 2 ...

  3. [Django](1093, quot;You can#39;t specify target table #39;fee_details_invoices#39; for update in...

    dele_id = Fee_details_invoices.objects.filter(fee_detail_id__in=fee_id_list, return_type='2').values ...

  4. bundle install 出现 #39;gem install mysql2 -v #39;0.3.15#39; succeeds before bunding #39;

    bundle install 出现  'gem install mysql2 -v '0.3.15' succeeds before bunding ' 解决:sudo apt-get install ...

  5. 玩转oracle 11g(39):oracle11g密码过期后的解决方法

    在使用oracle11g数据库的过程中经常会遇到密码180天过期的问题,这是因为oracle11g中默认在default概要文件中设置了"PASSWORD_LIFE_TIME=180天&qu ...

  6. #39;boost/iterator/iterator_adaptor.hpp#39; file not found之xcode生成时报错的解决方案

    xcode生成rn(0.49.3)项目的时候出现"'boost/iterator/iterator_adaptor.hpp' file not found之xcode"报错. 原因 ...

  7. mysql 39 t.id 39_ERROR 2003 (HY000): Can#39;t connect to MySQL server on #39;10.16.115.101#39; (1...

    ubuntu安装之后mysql,使用apt-get安装命令,默认为同意只本地访问 root@idata1:~/software# mysql -uroot -p123456 -h10.16.115.1 ...

  8. makefile:2: *** missing separator. Stop. make 之后出现的错误,解决方法

    问题 今天建立了个个helloworld.c 以及Makefile文件. hellworld.c 中内容如下: #include<stdio.h> int main() { printf( ...

  9. 这样给学妹讲原码、反码、补码,帮她彻底解决困扰了三天的问题

    前言 补码是给机器看的,原码是给人看的,反码是二者的桥梁,原码反码补码虽然是简单问题,但确实很多人很长时间没有搞明白和深入思考,这篇把自己学习和理解过程记录下来,刚好一个学妹问到这个问题.本篇只讲原码 ...

最新文章

  1. C语言Free时报错HEAP CORRUPTION DETECTED
  2. Pandas把dataframe中的整数数值(integer)转化为时间(日期、时间)信息实战
  3. grails 转为java_创建一个grails项目,然后转成maven项目
  4. Bellman-Ford 单源最短路径算法
  5. Leetcode 703. 数据流中的第K大元素 解题思路及C++实现
  6. Java,Math类中的ceil、floor和round函数源码解析以及自己重写实现
  7. 【Python】正负无穷
  8. ctags对部分目录生成tags
  9. html2canvas源码修改,html2canvas把div保存高清图的方法代码
  10. 201671010423 词频统计软件项目报告
  11. Windows Server 2003 ×××配置注意事项?
  12. 初级中级高级_初级职位,(半)高级职位
  13. if else if语句格式_Python_if 语句
  14. getifaddrs
  15. python函数第二次运行报错_(数据科学学习手札54)Python中retry的简单用法
  16. 新手初识安信可ESP8266 12f机智云开发板微信直连云
  17. 汇编语言典型例子详解_汇编语言例子
  18. ppt文件太大怎么压缩变小?
  19. Latex 宏定义中 \relax
  20. “创新驱动的结构化思维”培训

热门文章

  1. MySQL 5.1 的作业调度
  2. centos执行-查看,复制,删除-命令的脚本
  3. mysql创建utf-8字符集数据库
  4. 使用jQuery实现ajax几种方法
  5. Linux中升级更新命令yum upgrade和yum update的区别
  6. Rman--备份命令
  7. 有感于“政府傍大款”----谈中小企业融资问题
  8. Learning Perl(Perl语言入门)学习笔记(3)
  9. SignalR的另类实现技巧
  10. Android 实现闹钟功能