Hi there.
I was wondering, why isn't it necessary to link all the dependencies when I compile a game using SFML? For example, I'm now dealing with a game about audio, so I use -lsfml-graphics and -lsfml-audio. However, if I inspect the compiled program:
ldd ./programa
linux-vdso.so.1 => (0x00007fff2ee8e000)
libsfml-audio.so.1.6 => /usr/lib/libsfml-audio.so.1.6 (0x00007f8244546000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f8244240000)
libm.so.6 => /lib/libm.so.6 (0x00007f8243fbc000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f8243da6000)
libc.so.6 => /lib/libc.so.6 (0x00007f8243a23000)
libsfml-system.so.1.6 => /usr/lib/libsfml-system.so.1.6 (0x00007f8243819000)
libsndfile.so.1 => /usr/lib/libsndfile.so.1 (0x00007f82435b4000)
libopenal.so.1 => /usr/lib/libopenal.so.1 (0x00007f824335c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f8244789000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f824313e000)
libFLAC.so.8 => /usr/lib/libFLAC.so.8 (0x00007f8242ef4000)
libvorbisenc.so.2 => /usr/lib/libvorbisenc.so.2 (0x00007f8242a25000)
libvorbis.so.0 => /usr/lib/libvorbis.so.0 (0x00007f82427f8000)
libogg.so.0 => /usr/lib/libogg.so.0 (0x00007f82425f1000)
librt.so.1 => /lib/librt.so.1 (0x00007f82423e9000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f82421e4000)
There are many other libraries, specially libopenal, that get "automatically linked". How do you do it? It's interesting.
I've used OpenAl in other projects, and in all of them I had to either manually link using -lopenal, or use something like the output of pkg-config --libs