Run-Time Check Failure #0调试错误一例

简介:

今天在调试自己的Cocos2d-x游戏时出现如下错误提示:


Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is usually a result of calling a function declared with one calling convention with a function pointer declared with a different calling convention.同时出现如下错误提示对话框:

颇感疑惑!因为很长时间没有遇到这样的错误提示了。也许习惯了,一下就打开网络先搜索一下,在这里。从作者代码来看,是函数调用格式发生了变化所致。


于是,结合提示并根据自己的情形仔细分析,看上去是函数调用时有关参数栈不一致所致。忽然明白了--这部分代码已经是一个多月前的了,今天作了粗糙的修改,竟然把这个给忘记了。

我的第一部分代码如下:


1
2
3
Label* guidLabelText =  dynamic_cast <Label*>(ul->getWidgetByName( "guidLabelText" ));
     guidLabelText->setTouchEnabled( true );
     guidLabelText->addTouchEventListener( this ,toucheventselector(TutorialScene::nextCallback));

对应的自然要有回调函数的正确格式了,没有细细修改,就胡乱地复制代码了。

1
2
3
4
5
6
void TutorialScene::nextCallback( CCObject* pSender )
{
 
}
//修改一下便OK了,如下所示:
void TutorialScene::nextCallback( CCObject *pSender, TouchEventType type)

















本文转自朱先忠老师51CTO博客,原文链接:http://blog.51cto.com/zhuxianzhong/1425539  ,如需转载请自行联系原作者




相关文章
|
12天前
【Bug】ERROR ResizeObserver loop completed with undelivered notifications.
【Bug】ERROR ResizeObserver loop completed with undelivered notifications.
|
6月前
|
数据库 数据库管理
【异常解决】svn报“Previous operation has not finished; run ‘cleanup‘ if it was interrupted”的错误解决方案
【异常解决】svn报“Previous operation has not finished; run ‘cleanup‘ if it was interrupted”的错误解决方案
144 0
|
12月前
|
Python
pychram中提示:Process finished with exit code 0
"Process finished with exit code 0" 是PyCharm中的提示信息,表示程序已经成功地执行完毕并且没有发生任何错误。在PyCharm中,当程序正常终止并返回退出代码0时,这个消息会在控制台中显示。 在PyCharm中运行程序时,它会在一个单独的进程中执行,当程序完成执行后,它会向操作系统返回一个退出代码。退出代码0表示程序成功执行完毕,而非零的退出代码通常表示错误或异常终止。 当出现"Process finished with exit code 0"的提示时,意味着你的程序已经成功地执行完毕,没有发生任何错误或异常情况。你可以通过检查程序输出或任何其他预
1187 0
|
网络安全 开发工具
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
779 0
【解决方案】A session ended very soon after starting. Check that the command in profile “XXX” is correct.
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
267 0
TortoiseSVN报错:“Previous operation has not finished; run 'clean up' if it was interrupted“ 的解决方法
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法
218 0
svn报错:“Previous operation has not finished; run ‘cleanup‘ if it was interrupted“ 的解决办法
|
网络协议
Job for named.service failed because the control process exited with error code.怎么解决
本篇内容记录了如何解决Job for named.service failed because the control process exited with error code.的问题。
3070 0
Job for named.service failed because the control process exited with error code.怎么解决