SFML community forums

Help => General => Topic started by: DangerDays on January 25, 2015, 06:16:45 pm

Title: Segmentation Fault creating RenderWindow
Post by: DangerDays on January 25, 2015, 06:16:45 pm
I've just installed SFML 2.2 on my raspberry pi.
I wrote this just to test it out:
#include <SFML/Graphics.hpp>
#include <stdio.h>
using namespace sf;

int main()
{
        puts("Starting...");

        RenderWindow window(VideoMode(500,600), "Why don't you get a job?");
        Event event;

        puts("Entering loop...");

        while (window.isOpen())
        {
                while (window.pollEvent(event))
                {
                        if (event.type == Event::Closed)
                                window.close();
                }

                window.clear(Color::Blue);
                window.display();
        }

        puts("All Done!");
}

The program compiles fine, but when i run it, it gives a Segmentation Fault on the line where I create the RenderWindow. I ran it in gdb and got this:
Program received signal SIGSEGV, Segmentation fault.
0xb6bf6604 in glXCreateContext () from /usr/lib/arm-linux-gnueabihf/libGL.so.1

Is this a problem with SFML? Or is the problem with libGL.so? Or am I missing something obvious?

Info: I'm using SFML 2.2, My OS is Raspian (I'm using a raspberry pi), and I'm using the dynamic libraries of SFML...

Thanks! :)
Title: Re: Segmentation Fault creating RenderWindow
Post by: eXpl0it3r on January 25, 2015, 06:42:24 pm
Have you installed a graphics driver?
Title: Re: Segmentation Fault creating RenderWindow
Post by: DangerDays on January 25, 2015, 06:58:55 pm
No I haven't, I guess I need one?
Title: Re: Segmentation Fault creating RenderWindow
Post by: StormWingDelta on January 25, 2015, 07:01:11 pm
No I haven't, I guess I need one?

Yes you do, now if it's already installed it could need to be updated or could be another issue.