I'm on MSVC (VC Community 2019) and I just built SFML from source, debug and release shared libraries.
I copied the example code from sf::Window documentation
int main() {
// Declare and create a new window
sf::Window window(sf::VideoMode(800, 600), "SFML window");
// Limit the framerate to 60 frames per second (this step is optional)
window.setFramerateLimit(60);
// The main loop - ends as soon as the window is closed
while (window.isOpen()) {
// Event processing
sf::Event event;
while (window.pollEvent(event)) {
// Request for closing the window
if (event.type == sf::Event::Closed)
window.close();
}
// Activate the window for OpenGL rendering
window.setActive();
// OpenGL drawing commands go here...
// End the current frame and display its contents on screen
window.display();
}
}
When I build and run in debug mode it appears to work. When I compile and run through release mode (specifically when I close the window) I get
Unhandled exception at 0x00007FF6D7C62104 in graphics.exe: Stack cookie instrumentation code detected a stack-based buffer overrun. occurred
This comes from gs_report.c, I'm not sure if this is part of SFML or windows. The call stack does not indicate how it got to this exception.