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

Author Topic: SFML 2.0 Error while loading shared libraries libglew.so.1.5 while executing  (Read 1598 times)

0 Members and 1 Guest are viewing this topic.

chakal

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
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!
« Last Edit: January 18, 2016, 11:54:43 am by eXpl0it3r »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

chakal

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
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.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

 

anything