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!