SFML community forums

Help => General => Topic started by: DuCT on October 15, 2011, 04:04:31 am

Title: Shared Libraries problem
Post by: DuCT on October 15, 2011, 04:04:31 am
Okay, so I did a fresh install of Xubuntu 11.10, and when I try to run a run a simple program I get this error.


./a.out: error while loading shared libraries: libsfml-graphics.so.2: cannot open shared object file: No such file or directory

Everything compiles fine, so uh. Whats going on?

Oh, here's the code if it helps
Code: [Select]

#include <SFML/Graphics.hpp>

int main()
{
sf::RenderWindow window(sf::VideoMode(854, 480), "cos(x), the next Nullular Grapher!");

int x = 0;
int y = 0;

sf::Shape rect = sf::Shape::Rectangle(1, 1, 1, 1, sf::Color::Red);

while (window.IsOpened())
{
sf::Event event;
while (window.PollEvent(event))
{
if (event.Type == sf::Event::Closed)
{
window.Close();
}
}

window.Clear();

rect.SetPosition(1, 1);

window.Draw(rect);

window.Display();
}

return EXIT_SUCCESS;
}
[/code]
Title: Shared Libraries problem
Post by: Laurent on October 15, 2011, 10:46:02 am
Where is the shared library located? Make sure that it is known by the library loader (ld).
Title: Shared Libraries problem
Post by: DuCT on October 15, 2011, 03:56:30 pm
Apparently, the lib files weren't installed to /usr/lib, but to /usr/local/lib. Just did a simple copy paste as root and ran ldconfig -v as root. That seems to have fixed the problem.