GCC complains that it can't find shared libraries while linking

(written by Geert Uytterhoeven)

The current ld requires you to create links from *.so to *.so.6 for all libs, so you should have e.g. libX11.so -> libX11.so.6, libX11.so.6 -> libX11.so.6.0.

The development packages in Debian automatically handle this situation.