tags:

views:

27

answers:

1

I installed SFML from scratch today so I could work on a game. I downloaded the source, ran sudo make install, tried compiling one of my old projects, and I couldn't get it to link properly. So I tried running a simpler project: one of the samples in the tutorials. I tried to compile this one specifically, but I get these errors:

g++ -o atest test.cpp -lsfml-graphics -lsfml-window -lsfml-system /tmp/ccaa86fR.o: In function `main':
test.cpp:(.text+0x1d2): undefined reference to `gluPerspective'
collect2: ld returned 1 exit status
make: *** [test] Error 1

Trying an even simpler project, the one in the initial tutorial, I don't run into problems compiling. However, when I try to run it, I get this error:

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

I checked, and the files did install to /usr/local/lib/ which is where they're supposed to go as far as I know. What am I doing wrong here?

+1  A: 

-lGLU should fix the first error and for the second one make sure /usr/local/lib/ is in your ldconfig search path (/etc/ld.so.conf and /etc/ld.so.conf.d/* under Ubuntu) and that you ran ldconfig: sudo ldconfig -v then try running again.

see also man ldconfig

RC