Hi everyone,
I'm experiencing a strange behavior on SFML 2.3.2 with Visual Studio 14. I'm using the precompiled library that can be found here :
http://www.sfml-dev.org/download/sfml/2.3.2/I'm using the debug dlls.
The symptom is a segfault when I try to use the member function setString on an sf::Text object.
Useful infos :
- _statsString is an attribute of the Application class ;
- I'm mixing SFML and openGL calls ;
- this is part of a game engine (some of you may recognize some things from the SFML Game Dev book - great book !).
Here are the most relevant parts of the code :
In the Application constructor, where I load my font and set some options of _statsString :
Application::Application() :
...
{
if (!_statsFont.loadFromFile("Sansation.ttf"))
throw std::runtime_error("Error loading statistics font");
_statsString.setFont(_statsFont);
_statsString.setPosition(5.f, 5.f);
_statsString.setCharacterSize(10);
}
When the segfault occurs :
void Application::_updateStats(sf::Time dt)
{
_statsUpdateTime += dt;
_statsFrameCount += 1;
if (_statsUpdateTime >= sf::seconds(1.0f))
{
_statsString.setFont(_statsFont);
_statsString.setString("FPS: " + std::to_string(_statsFrameCount)); // <- Oh damn.
_statsUpdateTime -= sf::seconds(1.0f);
_statsFrameCount = 0;
}
}
Visual's debugger is telling me that _statsString is a symbol not found, which is strange cause any other method seems to work properly...
Last but not least, under the MSYS2 toolchain (msys2 + mingw-w64) and with the 2.3.1 which I compiled myself, this bug does not occur.
Anyone has a clue on what's happening ?
Thanks a lot !