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

Author Topic: Segmentation Fault creating RenderWindow  (Read 1811 times)

0 Members and 2 Guests are viewing this topic.

DangerDays

  • Newbie
  • *
  • Posts: 2
    • View Profile
Segmentation Fault creating RenderWindow
« 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! :)
« Last Edit: January 25, 2015, 06:24:56 pm by DangerDays »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: Segmentation Fault creating RenderWindow
« Reply #1 on: January 25, 2015, 06:42:24 pm »
Have you installed a graphics driver?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

DangerDays

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Segmentation Fault creating RenderWindow
« Reply #2 on: January 25, 2015, 06:58:55 pm »
No I haven't, I guess I need one?

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: Segmentation Fault creating RenderWindow
« Reply #3 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.
I have many ideas but need the help of others to find way to make use of them.

 

anything