the reference was undefined when trying to use box2d’s b2bodysetuserdatavoid function

Turns out SetUserData was recently removed in Box2D 2.4.1. I’ve also noticed some of my old code that used the b2BodyDef method (I had forgotten I used that in the past) would no longer compile; previously it was just a direct void* pointer without the issue I mentioned.

Instead of doing foo->SetUserData(bar), now it seems the correct way is foo->GetUserData().pointer = bar. (Source)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top