I'm using Visual C++ 2010. The following code crashes when starting a debug session when linked to the SFML static debug libraries. It works FINE debugging when linked to the shared debug SFML libraries! Also, if you comment out the _window member, it works fine with the static libraries. Any ideas why?
#include "SFML\Graphics.hpp"
class Singleton {
protected:
Singleton() { }
static Singleton _singleton;
sf::RenderWindow _window;
};
Singleton Singleton::_singleton;
int main(int argc, char *argv[])
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}