SFML community forums

Help => General => Topic started by: chakal on January 18, 2016, 11:10:29 am

Title: SFML 2.0 Error while loading shared libraries libglew.so.1.5 while executing
Post by: chakal on January 18, 2016, 11:10:29 am
I am trying to install SFML2.0 on Ubuntu 15.10 but I am having issues during the execution of the file.

The code that I want to execute is the following.

#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;
}

I compile the code with the following command:
g++ -Wall main.cpp -o main.o -L/usr/local/lib -I/usr/local/include
-lsfml-graphics -lsfml-window -lsfml-system

and the compilation works fine! However, when I try to execute ./main.o I am getting

./main.o: error while loading shared libraries: libGLEW.so.1.5: cannot open
shared object file: No such file or directory

I already had an error message related to libGLEW.so.1.5 while compiling of the same code saying

/usr/bin/ld: warning: libGLEW.so.1.5, needed by /usr/local/SFML-2.0/lib/libsfml-graphics.so,
not found (try using -rpath or -rpath-link)

However, the installation with of libGLEW.so.1.5 with apt-get install libglew1.5 solved the issue in the compilation and the the problem right now is in the execution of the file. Do you have any ideas what can I do to solve the problem? Thank you!
Title: Re: SFML 2.0 Error while loading shared libraries libglew.so.1.5 while executing
Post by: eXpl0it3r on January 18, 2016, 11:56:50 am
It has already been said to you, you're using a very old and outdated version of SFML, which was compiled using GLEW 1.5, which by now is not installed on your system anymore by default. Update to SFML 2.3.2 and you won't even have to deal with GLEW, since it got removed.

And if you want to make sure that your dependencies all match nicely, it's highly recommended to build SFML from source.
Title: Re: SFML 2.0 Error while loading shared libraries libglew.so.1.5 while executing
Post by: chakal on January 18, 2016, 12:32:28 pm
The problem is that I am upgrading a game that was written in SFML 2.0. If I pass to SFML 2.3.2, I don't think the code will compile.
Title: Re: SFML 2.0 Error while loading shared libraries libglew.so.1.5 while executing
Post by: eXpl0it3r on January 18, 2016, 01:02:09 pm
Unless it has been written with a pre SFML 2.0 release version, it should work just fine with SFML 2.3.2. SFML 2 is API backwards compatible.