VerletSFML icon indicating copy to clipboard operation
VerletSFML copied to clipboard

Mini fix for addObject function

Open ekinilseven opened this issue 3 years ago • 0 comments

Apologies ahead of time, first time commenting on Github.

When trying to run your code, I received the following error:

In file included from ./main.cpp:3: ./solver.hpp:66:56: error: member reference base type 'void' is not a structure or union return m_objects.emplace_back(position, radius);

It was fixed when I redefined the addObject function in Solver class:

Original: VerletObject& addObject(sf::Vector2f position, float radius) {
return m_objects.emplace_back(position, radius); }

Fix: VerletObject& addObject(sf::Vector2f position, float radius) {
m_objects.emplace_back(position, radius); return m_objects.back(); }

ekinilseven avatar Oct 12 '22 12:10 ekinilseven