erincatto / box2d

Box2D is a 2D physics engine for games
https://box2d.org
MIT License
8.36k stars 1.55k forks source link

Sample compile error - w/workaround #762

Closed onehundredfeet closed 9 months ago

onehundredfeet commented 9 months ago

Make sure these boxes are checked before submitting your issue - thank you!

Just an FYI that on the Mac, I get errors compiling the samples. I can work around just by not building the samples.

/box2c/samples/sample_shapes.cpp:304:36: error: taking the address of a temporary object of type 'b2ShapeDef' [-Waddress-of-temporary]
                        b2CreatePolygonShape(m_ship1Id, &b2DefaultShapeDef(), &right);
                                                        ^~~~~~~~~~~~~~~~~~~~
...
                                                           ^~~~~~~~~~~~~~~~~~~
/box2c/samples/sample_shapes.cpp:473:35: error: taking the address of a temporary object of type 'b2ShapeDef' [-Waddress-of-temporary]
                        b2CreateSegmentShape(groundId, &b2DefaultShapeDef(), &segment);
erincatto commented 9 months ago

Oh right, I should add the samples to macos CI. I created this issue over on box2c.

https://github.com/erincatto/box2c/issues/128