This goes even stranger... I tried "Hello Chipmunk" example.
If I compile it in release mode, it will work fine. But If I build in debug mode, "Access violation" will happen in body.c in cpBodyAddShape
Code: Select all
cpBodyAddShape(cpBody *body, cpShape *shape)
{
cpShape *next = body->shapeList;
if(next) next->prev = shape; // <<<<----- here
shape->next = next;
body->shapeList = shape;
}
and program print to console:
Code: Select all
Aborting due to Chipmunk error: This shape is already added to a space and canno
t be added to another.
Failed condition: !shape->space
[/size]
But if I add line
before including chipmunk.h and I build in debug mode, program will work correctly.
And If I then (with "CP_USE_DOUBLES 0") build it in release mode, "Access violation" will happen at line
I'm using VS2010 and I downloaded latest Chipmunk release and I built it using vs2010 solution file.
Edit: Okey... I think, I somehow built using old library version or something...
Now without "CP_USE_DOUBLES 0" debug mode works fine. But "CP_USE_DOUBLES 0" and release build mode combination still crashes.
Edit2: If I remove static "ground" body, program doesn't crash, but ballBody's position won't change (it's (-1.#J,0.0) ) and vertical velocity is very high (-0.00, 160801377226902880000000000000000000000.00).