Before getting to the issue I’m typing down everything I did regarding the setup:
-
Downloaded
GCC 13.1.0 MinGW (DW2) - 32-bit
from SFML official site and its proper compiler from the same site. -
Added GCC 13.1.0 MinGW to the PATH variable
-
Created a new Project in Eclipse specifying MinGW GCC as the toolchain
-
Added
SFML-2.6.1include
to the Project Compiler include paths -
Added
SFML-2.6.1lib
to the Project Linker libraries search path -
Added
sfml-graphics, sfml-window, sfml-system
to the Project Linker libraries -
Created a main.cpp with the following code:
#include <SFML/Graphics.hpp> #include <iostream> int main() { std::cout << "test"; sf::RenderWindow window(sf::VideoMode(200,200), "Hello World"); sf::CircleShape shape(100.f); shape.setPointCount(128); 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; }
-
Built the Project successfully
-
Copied every .dll found in the bin directory of SFML to the same path where the .exe is
When I try running the code it instantly gets terminated with no output.
If I comment everything but the cout and the return, instead, I properly get a console output.