SFML community forums

Help => General => Topic started by: Pwishie on March 11, 2017, 07:21:38 am

Title: Can't quite get it to work in Linix
Post by: Pwishie on March 11, 2017, 07:21:38 am
I've almost got SFML working on my linux computer, but every time I test my code the window pops up for a second and immediately disappears.  I've tried messing around with the build settings as much as possible and there are no errors at compile-time.  All help is appreciated.
Title: Re: Can't quite get it to work in Linix
Post by: Turbine on March 11, 2017, 07:26:50 am
We don't have enough info to go on sorry.

I'd suggest you post some code.
Title: Re: Can't quite get it to work in Linix
Post by: Pwishie on March 11, 2017, 07:34:53 am
#include <SFML/Graphics.hpp>

int main()
{
    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;
}
It's literally just the code SFML has you use to test if it works
I would like to add that I was able to get this to work on windows in the past with Code Blocks and MINGW.  Now I can't get it to work on Linux with CodeBlocks and GCC.  I followed the instructions on how to get it working on CodeBlocks exactly
Title: Can't quite get it to work in Linix
Post by: eXpl0it3r on March 11, 2017, 09:19:25 am
Run it through gdb and figure out what happens.