map/set iterator not dereferencable
来源:互联网 发布:北欧移民知乎 编辑:程序博客网 时间:2024/05/21 21:47
//////Grant推荐:////////////
QT学习之路:从入门到精通
http://blog.51cto.com/zt/20/1
///////////////////////
Crash when starting QuteCom 3.0 in Windows
Robert Verspuy Thu, 26 May 2011 07:56:59 -0700
But when I start Qutecom it crashes right away, with the following messages in the log:
(error) 16:30:03 [Common] ConfigManagerFileStorage::loadSystemConfig: Could not open C:\Program Files\qutecom-2.99.0\/config/config.xml (fatal) 16:30:03 [Common] C:\QuteCom\QC3.0\libs\owutil\settings\src\Settings.cpp:163Settings::getAny: key 'config.version' does not existThe cause of this is because Quotecom is looking for a config file in qutecom-2.99.0\/config/config.xml but the config file is installed in qutecom-2.99.0/config/config/config.xml
Also other the subdirs like chat, css, sounds, webpages exist twice.I'm looking into the nsis script to see if I can find a solution.But I think this should not give a crash.When debugging the crash with MS Visual C++ 2008, I saw that, because the config.xml could not be found there's somthing going wrong with reading the default configvalues.
In owsettings \ settings.cpp (line 160 -function Settings::getAny)There is a _KeyMap.find(key) (where key is in this case config.version).But the _KeyMap is not an object, it's just "(0)[]" (according to the debugger).So I think this _KeyMap object is not correctly initialized, when no configfile can be found.
"
Hi, I just wanted to start wengophone in the debug directory. I know there is a resource parameter, but I can't find it out cause passing --help already tries to access the resource directory. This is stupid. Initialization is done too early.
"
解决办法: 将 Resources/config文件夹 移至程序所在的Debug目录下
http://bbs.csdn.net/topics/240085292
while(map_set!=map_temp->second.end())
{
map_ciku=ciku.find(atoi((*map_set).c_str ()));
result1.insert(make_pair(map_ciku->second,0));
++(map_result1->second); //程序在这里中断了,下面程序执行不了了,
++map_set;
}
怎么不给出具体出错行数?如果是因为直接双击错误定位到了STL库的头文件中:debug的时候看Call Stack(调用堆栈),从上到下一行行双击,最后定位到上面源代码的某一行,错误就在那一行上。
第一行如果find未找到你参数里指定的字符串,将返回ciku.end(),那么map_ciku->second就是错的。
所以一般在第一行后加入一个判断:
1
2
3
4
5
6
7
8
if
(map_ciku != ciku.end())
{
result1.insert(make_pair(map_ciku->second,0));
}
else
{
// 未找到则做相应处理
}
STL迭代器失效问题
0人收藏此文章, 我要收藏发表于8个月前(2012-04-24 23:01) , 已有448次阅读 ,共5个评论
- map/set iterator not dereferencable
- map/set iterator not dereferencable
- map/set iterator not dereferencable异常
- VS2008 下 map/set iterator not dereferencable
- 错误map/set iterator not dereferencable
- map/set iterator not dereferencable异常
- [C++杂记] map/set iterator not dereferencable异常
- 使用C++的map容器遇到的bug(map/set iterator not dereferencable)
- 使用C++的map容器遇到的bug(map/set iterator not dereferencable)
- STL 二分查找抛出错误(map/set iterator not dereferencable)
- list iterator not dereferencable
- deque iterator not dereferencable 问题
- map/set iterator not incrementable
- map/set iterator not incrementable
- STL ---vector iterator not dereferencable错误
- deque iterator not dereferencable 队列不能使用
- Debug Assertion Failed ! List iterator not dereferencable
- 关于错误map/set iterator not incrementable
- 拷贝构造函数(深拷贝,浅拷贝)
- 如何得到某周,月的第一天和最后一天的日期
- Oracle 中 误删 emp,dept ,恢复 emp 和 dept表的sql脚本.
- 帮助刚接触j2se或不懂如何打包jar文件
- microsoft Enterprise Library微软企业库,资料整理
- map/set iterator not dereferencable
- 多线程控制进度条
- Sencha的Eclipse插件提示和技巧
- APK逆向工程
- const 作用
- Shell 笔记
- Oracle64位客户端直连Arcsde10.0
- 详谈 Jquery Ajax异步处理Json数据.
- sizeof VS strlen