Reduced the code to the following:
sf::Font f2;
if (!f2.loadFromFile("DejaVuSans.ttf"))
{
condition=false;
owner->setdbgstr("error");
}
else
{
owner->setdbgstr("no error");
sf::Text tx;
tx.setFont(f2);
tx.setString("i run");
draw(tx);
}
Still got the crashes. Then I tried to get individual glyphs from the texture, but at this line:
sf::Glyph glyph = f2.getGlyph(codePoint, characterSize, bold);
I got the following error:
undefined reference to `sf::Font::getGlyph(unsigned int, unsigned int, bool, float) const
The function seems to not be implemented.