SFML runtime problem

I have no errors with compiling my program like this:

g++ -o client test2.o -lsfml-network -lsfml-system

but when I run "client", I get the error:

"./client: error while loading shared libraries: libsfml-network.so.1.6: cannot open shared object file: No such file or directory"

I even tried compiling my program with -L/usr/local/lib but that still does not work do anything. Thanks for any help.
Ensure that the directory containing the .so is in your LD_LIBRARY_PATH.
Is it possible to use -L? In Windows that adds a library search path temporarily.

Ex:
g++ main.cpp -LC:\SFML-1.6\Lib -lsfml-system -lsfml-window
Last edited on
The problem is a runtime problem. The loader can't find libsfml-network.so.1.6. The loader looks in certain pre-defined directories and LD_LIBRARY_PATH to find the library. It's not in any of those, so the solution is to find the library and add it's path to LD_LIBRARY_PATH.
woah woah does the program compile at alll? does that error display when you RUN the program? :S

ok so here are 5 possible steps (stop whenever it starts working :P)

1. run
sudo ldconfig

2. re-install SFML
3. install SFML from source (sometimes the repo has a bad copy)
4. run
sudo ldconfig again

5. Insall SFML2 ... it is still in developement but its coming along

All the best! Good luck!
Last edited on
Topic archived. No new replies allowed.