Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Can't quite get it to work in Linix  (Read 1747 times)

0 Members and 1 Guest are viewing this topic.

Pwishie

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Can't quite get it to work in Linix
« 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.

Turbine

  • Full Member
  • ***
  • Posts: 100
    • View Profile
Re: Can't quite get it to work in Linix
« Reply #1 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.

Pwishie

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Can't quite get it to work in Linix
« Reply #2 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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11016
    • View Profile
    • development blog
    • Email
Can't quite get it to work in Linix
« Reply #3 on: March 11, 2017, 09:19:25 am »
Run it through gdb and figure out what happens.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything