SFML runtime problem

Jul 10, 2011 at 6:18pm
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.
Jul 10, 2011 at 10:22pm
Ensure that the directory containing the .so is in your LD_LIBRARY_PATH.
Jul 11, 2011 at 2:25am
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 Jul 11, 2011 at 2:28am
Jul 11, 2011 at 2:38am
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.
Jul 12, 2011 at 1:37pm
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 Jul 12, 2011 at 1:37pm
Topic archived. No new replies allowed.