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

Author Topic: Problem with installation in Ubuntu SFML 1.6  (Read 3145 times)

0 Members and 1 Guest are viewing this topic.

sinefault

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« on: October 21, 2011, 08:53:58 pm »
Okay, I'm new to SFML, so it's most likely that I'm doing something wrong. But, regardless, here's the problem I'm having:

I followed the instructions on how to install SFML on Linux. Tested the clock test, all good. Next, I tried to create a window... and that's when the problem arose. The window opens for a fraction of a second, then closes and reports a segfault. In Eclipse I tried it as well, and it told me:

Code: [Select]
Failed to open a connection with the X server
Failed to open a connection with the X server


I then tried to install SFML via the software center, in case I had done something wrong... and then I started getting the error:

Code: [Select]
symbol lookup error: /usr/local/lib/libsfml-window.so.1.6: undefined symbol: _ZN2sf7Unicode11UTF8OffsetsE

Here's the code I'm trying to run:
Code: [Select]
#include <SFML/Window.hpp>

int main() {
    sf::Window App(sf::VideoMode(800, 600, 24), "SFML Window");
    sf::Event Event;
    bool running = true;
    while (running) {
        while (App.GetEvent(Event)) {
            if (Event.Type == sf::Event::Closed)
                running = false;
        }
        App.Display();
    }
    return EXIT_SUCCESS;
}


Help would be much appreciated.

Weeve

  • Jr. Member
  • **
  • Posts: 87
  • C++ Programmer (Intermediate), 3D Artist (Skilled)
    • View Profile
    • Email
Problem with installation in Ubuntu SFML 1.6
« Reply #1 on: October 21, 2011, 09:00:05 pm »
did you remember to compile with "-lsfml-system" and  "-lsfml-window ",

and you might try to include "#include <SFML/System.hpp>"
Long live rapid project development! -- Kestrel3D Game-Engine nearing completion

sinefault

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« Reply #2 on: October 21, 2011, 10:05:49 pm »
yep, compiling with both of those (without them it refuses to compile).

Tried including System.hpp, no dice, same problem.

Elusive

  • Newbie
  • *
  • Posts: 10
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« Reply #3 on: October 21, 2011, 11:13:23 pm »
I encountered the same problem a few weeks ago. The SFML libraries are probably missing in your LD_LIBRARY_PATH. Try reconfiguring ld:
Code: [Select]
$ sudo ldconfig -v
That did it for me.

sinefault

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« Reply #4 on: October 21, 2011, 11:47:29 pm »
Tried that, it did help me get the clock test running, but didn't help me create a window. Well, here's something interesting I got via valgrind:

Code: [Select]
Invalid write of size 8
==14273==    at 0x4C2A32C: memcpy (mc_replace_strmem.c:635)
==14273==    by 0x86C26FB: ??? (in /usr/lib/fglrx/dri/fglrx_dri.so)
==14273==    by 0xA3D722F: ???
==14273==  Address 0x7f6ca5024638 is not stack'd, malloc'd or (recently) free'd


Looks like it's an issue with my graphics driver (fglrx)? If it helps, I've got 2x Radeon HD 6970s running in crossfire. And running the Oneiric Ocelot release of Ubuntu.

Elusive

  • Newbie
  • *
  • Posts: 10
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« Reply #5 on: October 21, 2011, 11:55:30 pm »
The ATI linux drivers are really bad and very rarely updated, but this kind of thing seems to be normal when using OpenGL. Take a look at this: http://stackoverflow.com/questions/1997171/why-does-valgrind-say-basic-sdl-program-is-leaking-memory

What is happening exactly? Is the window even visible? Is the compiler warning about something?

sinefault

  • Newbie
  • *
  • Posts: 4
    • View Profile
Problem with installation in Ubuntu SFML 1.6
« Reply #6 on: October 22, 2011, 12:09:27 am »
A frame pops up momentarily, then it crashes and gives a segfault. Unless I run it with valgrind, which manages to suppress some errors, and thus the window does open... only it's not black, it's got garbled colours and noise.

The compiler warns of nothing, compiles just fine. I've written OpenGL applications using LWJGL which works just fine, and I've tested freeglut as well, for a simple OpenGL app, no problem there either. So there's got to be more to it than just a poor graphics driver.