When building a program designed to run in the X Window System I encountered the following error message:
make[1]: Entering directory `/usr/src/redhat/SOURCES/aterm-0.3.6/src'
gcc -O -o aterm [numerous object files elided] -lX11
/usr/bin/ld: cannot find -lX11
I was sure that I'd installed the X development package, so that wasn't the problem. (If you haven't already installed it, you may want to read Finding an RPM on the distribution media.) Why then couldn't the development environment find libX11.so?
It turns out that the /usr/X11R6/lib directory isn't part of the default ld(1) search path, so I needed to have the flag "-L/usr/X11R6/lib" somewhere before "-lX11" in the offending command.