How do you guys debug with cocos2dx?


I have built a project and followed the tutorials in cocos2dx.

But I meet a problem when I start to program with cocos2dx.

That is, I always get a strange close of program without any error message or log?

For example, when I change the code from tutorial :
CCSprite* pSprite = CCSprite::spriteWithFile(“HelloWorld.png”);
to :
CCSprite* pSprite = CCSprite::spriteWithFile(“map.png”);

It is wrong because I don’t add this picture to Resource folder

But I don’t receive any message telling me that there is no file called “map.png”

It just closed down everytime when I run this program……

How you guys debug with this???
Thank you

  • Yu-Chih

  1. I prefer to debug game logic in visual studio or xcode, before running it in android device.
  2. In early versions, I added a CCMessageBox to notify missing resource error. But I’m not sure if this invoke is skipped in recent versions.


Thanks for your reply

I trace the code, and find some lines (such as ) that try to notify the missing file
But these messages do not show up in my logcat…@@

Is there any DEBUG flag that I must set to show these in my eclipse???


CCMessageBox is to pop up a message box, not to show the message the logcat.