title: Why link libraries (like pthread) when they are in the right folder "/lib" and "/usr/lib"?
body: <p><strong>1. Why do we need to link the non standard libraries/include non standard header files  when they are already present in the right folder</strong></p>
  
  <pre><code>anirudh@anirudh-Aspire-5920:~/Documents/DUMP$ locate libpthread
  /lib/libpthread-2.12.1.so
  /lib/libpthread.so.0
  /usr/lib/libpthread.a
  /usr/lib/libpthread.so
  /usr/lib/libpthread_nonshared.a
  /usr/lib/xen/libpthread.a
  /usr/lib/xen/libpthread_nonshared.a
  anirudh@anirudh-Aspire-5920:
  </code></pre>
  
  <p>The man page of <code>ld.so/ld-linux.so - dynamic linker/loader</code> says that the necessary libraries required by a program are searched <code>In the default path /lib, and then /usr/lib.</code>
  When my library's .so file is already there in /lib folder then why do I need to link it exclusively. 
  Also the <code>-l</code> option is used to link static libraries. but when I do pmap of the process I see that the dynamic library of pthread with <code>.so</code> extension is being used rather than the one with <code>.a</code> extension.
  Similarly </p>
  
  <pre><code>anirudh@anirudh-Aspire-5920:~/Documents/DUMP$ locate mysql.h
  /usr/include/mysql/mysql.h
  anirudh@anirudh-Aspire-5920:~/Documents/DUMP$
  </code></pre>
  
  <p>When it is already present in the folder <code>/usr/include</code> which is the standard folder for all header files then why do I need to include it exclusively using <code>-I</code> option.</p>