Greetings
I'm having an issue with running SFML apps.
They compile with no problem, but when I run them, it segFaults on window.Clear();
main.cpp
#include <SFML/Graphics.hpp>
int main() {
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Start the game loop
while (window.IsOpened()) {
// Process events
sf::Event event;
while (window.PollEvent(event)) {
// Close window : exit
if (event.Type == sf::Event::Closed) {
window.Close();
}
}
// Clear screen
window.Clear();
// Update the window
window.Display();
}
return EXIT_SUCCESS;
}
and to compile i use
g++ -g -o main main.cpp -lGL -lGLU -lsfml-system -lsfml-window -lsfml-graphics && ./main