The -l option tells the linker to search the libraries in the standard dirs.
And with -L, we can specify our own library directories for searching.
Question: Does the sequence of order matters for the -L option too, like it does for the -l w.r.t the linker?
This link: http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html doesn't say much about the sequence of -L.
EDIT Also,
Directories specified on the command line are searched before the default directories
is from the man page (as pointed by Dmitry), does this mean that even if I specify the order like:
gcc -lm hello.c -Lx
still the directory specified with -L will be given preference first?