I generated a cross-platform project using the code-generator.py with -language cpp.
I haven’t change any code, I’m using just the code generated by the python script, which is a simple game with the logo of cocos2d-x.
When I try to compile the proj.win32 version, it compiles and run fine inside visual studio (using the debugger).
But when I run it from outside, just double clicking the .exe, I get the following exception:
MiniGame.exe has stopped working.
Unhandled exception at 0x011C2467 in MiniGame.exe: 0xC0000005: Access violation reading location 0x00000000.
When I debug the program, the error displayed is in this line:
pSprite->setPosition(ccp(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y));
It seems that some pSprite variables are not in the memory any more. Here is a screenshot of the debugging:
Am I doing something wrong? Why I got this error only when running the application from outside?