Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while loading shared libraries: libsfml-graphics.so.2.2.0

Full Error: error while loading shared libraries: libsfml-graphics.so.2.2.0: cannot open shared object file: No such file or directory

This is probably the quintillionth time I've run into this error with SFML. This error oddly only occurs when running the executable, rather than during compilation. I don't know what is causing the error (apart from the program not finding the file), since it worked like a charm before I reinstalled Ubuntu. I've tried sudo ldconfig and I have used sudo apt-get install libsfml-dev, but I don't link SFML using it, but from an extracted archive.

like image 984
bboy3577 Avatar asked Jul 31 '26 14:07

bboy3577


1 Answers

This answer relies on libsfml-dev being installed on your system. The way to fix it is removing all SFML options from the Search Directories>Linker, then make sure the linker settings looks something like this:

Linker Settings example

This means that CodeBlocks will link to the default place. Afterwards recompile the code (Edit the code so CodeBlocks will actually compile it). I was running g++ 4.9.2 but I'm not sure if the default 4.8.2 works, or if it makes any difference at all.

like image 118
bboy3577 Avatar answered Aug 02 '26 03:08

bboy3577



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!