关于Symbian的"crosses initialization of XXX"错误
2007-11-22 13:43
441 查看
昨天,同事在把前一阶段的项目编译、打包成sis安装文件时,遇到如下的编译错误 :
crosses initialization of XXX
同事向我请教,我仔细看了一下他的代码,并没有什么问题。这个错误提示很少见,于是Google了一下,找到如下一篇论坛上的资料:
Problem: You get an error of this form, while compiling some nice program from source:
![]() Reason: The problem is that there is a declaration of an object (the boolean "pushed") without scope. Thus, the scope of the object could traverse the break statement and apply to the next case. Consider this - what is the scope of obj1 in the code below? It starts at the first label, and goes until the end of the case block. So it's in scope at CHOICE_B. But its constructor wasn't called....
![]() Solution: Change the case statement to:
![]() References: Bug#180937: g++ internal compiler error: Error reporting routines re-entered Bug#180937: g++ internal compiler error: Error reporting routines re-entered _________________ Regards Chris Karakas www.karakas-online.de ====================================================== 注: 该资料的网址为:http://www.karakas-online.de/forum/viewtopic.php?t=4194 |
原来如此!问题出在case语句内定义的变量的作用域上面。只要把每个case语句用括号(" {} ")括起来,变量的作用域限定在相应case语句之内,就不会出现交叉初始化(crosses initialization )的错误,问题随之解决。
附:上面论坛资料的pdf格式文件的下载(我的box中的资源,版权归原论坛所有):
下载地址http://www.box.net/shared/ptpqtymqvz |
相关文章推荐
- 关于Symbian的"程序已经关闭"错误
- error: jump to case label与crosses initialization of"xx"编译错误
- c++ GUI Qt4 的关于forward declaration of "class xxx 的错误"
- 关于crosses initialization of “XXX的问题
- 关于Symbian的"程序已经关闭"错误
- 关于Symbian的"程序已经关闭"错误
- 关于退域重新加域时,出现"拒绝访问"错误提示
- "error while loading shared libraries: xxx.so.x" 错误的原因和解决办法
- 关于dao层Bean注入失败报No qualifying bean of type [xxx.xxx.xxx.xxx] is defined错误的问题
- 关于 "the serializable class XXX does not declare a static final seriaVersionUID..."的问题
- 关于"不能联系到XXX域控制器"错误,排查错误原因.
- 关于"通过端口 1433 连接到主机 127.0.0.1 的 TCP/IP 连接失败"的错误解决
- 解决关于"char-major-10-135"的错误
- error: jump to case label error: crosses initialization of xxx
- 关于JS出现的Cannot read property 'XXX' of null错误
- crosses initialization of “XXX”
- 关于"XML 文档(2, 2)中有错误:不应有 <xml xmlns=''>"错误
- 关于clover2运行时出现的"annotations are not supported in -source 1.3"错误的解决
- 关于Symbian的"程序已经关闭"错误
- 关于Symbian的"程序已经关闭"错误