SIGSYS crash
Posted: Fri Sep 07, 2012 12:20 pm
Hi, I am new to this stuff and I am having a really annoying issue that no one else seems to be having, so I am obviously doing something wrong. I built a game that runs perfectly fine on the simulator, but crashes almost immediately when I run it on a device. I factored out this simple case:
And what happens is, the program receives a SIGSYS signal, at the stack trace:
at the first cpSpaceAddShape call.
I couldn't find anything with Google that was helpful, so hopefully someone here can point me in the right direction. Some kind of compiler setting maybe?
Code: Select all
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
cpInitChipmunk();
cpSpace* space = cpSpaceNew();
space->sleepTimeThreshold = INFINITY;
cpVect grav = cpv(0, GAME_GRAVITY);
cpSpaceSetGravity(space, grav);
cpSpaceSetIterations(space, SPACE_ITERATIONS);
double viewHeight = self.view.bounds.size.height;
double viewWidth = self.view.bounds.size.width;
cpBody* rbound = cpBodyNewStatic();
cpBody* lbound = cpBodyNewStatic();
cpShape* lboundShape = cpSegmentShapeNew(lbound, cpv(0,0), cpv(0,viewHeight),0);
cpShape* rboundShape = cpSegmentShapeNew(rbound, cpv(viewWidth,0), cpv(viewWidth,viewHeight), 0);
cpShapeSetElasticity(lboundShape, 0.2);
cpShapeSetElasticity(rboundShape, 0.2);
cpShapeSetFriction(lboundShape, 0);
cpShapeSetFriction(rboundShape, 0);
cpSpaceAddShape(space,rboundShape);
cpSpaceAddShape(space, lboundShape);
}
Code: Select all
0 leafSetTrans
1 cpBBTreeInsert
2 cpSpaceAddStaticShape
3 cpSpaceAddShape
4 -[PPTestViewController viewDidLoad]
I couldn't find anything with Google that was helpful, so hopefully someone here can point me in the right direction. Some kind of compiler setting maybe?