Never make your sf::RenderWindow global or static.
The SFML developer stated that global RenderWindow can cause issues:
Don't declare your RenderWindow in global scope, something happens in its constructor and some internal objects of SFML might not be initialized at this point.