在生成android版本时候出现的蛋疼问题Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1),
时间:2014-01-21 09:19:16
收藏:0
阅读:1096
01-11 19:47:57.153: A/libc(27675): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 27675 (com.bs.game)
出现这个问题我查了好久,在xcode上编辑以及跟windows上编辑都没有报错,查了好久
这个错误是因为我在cpp中定义了一个内部全局变量,我以为能在函数外部给它付好值,结果并不是我想的那样,就一直报题目那个错误
如下
std::string path = CCFileUtils::sharedFileUtils()->getWritablePath();我写在了函数外
所以报的错,最后我的修改时在.h中定义全局path 然后再到 函数外边给他付空值,再到构造函数里面给他付以上写法的值,果然就成功了
如下DataControl是我自己的类
std::string DataControl::path = "";
DataControl::DataControl(void)
{
path = CCFileUtils::sharedFileUtils()->getWritablePath();
}
原文:http://blog.csdn.net/five50/article/details/18279061
评论(0)