title: can't add library directory to ld
body: <p>I have created my own library directory in my home (<code>/home/mathieu/lib</code>). I have one lib called <code>libmath.so</code> in this directory.
  To add this directory to <code>ld</code>, I have added the path in te file <code>/etc/ld.so.conf</code>. I've reloaded the cache by executing <code>sudo ldconfig</code>.
  When I execute <code>sudo ldconfig -p | grep libmath.so</code> I get <code>libmath.so (libc6) =&gt; /home/mathieu/lib/libmath.so</code>. So it works.</p>
  
  <h3>The problem</h3>
  
  <p>When I execute <code>ld -lmath</code> I get:</p>
  
  <pre><code>attempt to open /usr/i486-linux-gnu/lib32/libmath.so failed
  attempt to open /usr/i486-linux-gnu/lib32/libmath.a failed
  attempt to open /usr/local/lib32/libmath.so failed
  attempt to open /usr/local/lib32/libmath.a failed
  attempt to open /lib32/libmath.so failed
  attempt to open /lib32/libmath.a failed
  attempt to open /usr/lib32/libmath.so failed
  attempt to open /usr/lib32/libmath.a failed
  attempt to open /usr/local/lib/i386-linux-gnu/libmath.so failed
  attempt to open /usr/local/lib/i386-linux-gnu/libmath.a failed
  attempt to open /usr/local/lib/libmath.so failed
  attempt to open /usr/local/lib/libmath.a failed
  attempt to open /lib/i386-linux-gnu/libmath.so failed
  attempt to open /lib/i386-linux-gnu/libmath.a failed
  attempt to open /lib/libmath.so failed
  attempt to open /lib/libmath.a failed
  attempt to open /usr/lib/i386-linux-gnu/libmath.so failed
  attempt to open /usr/lib/i386-linux-gnu/libmath.a failed
  attempt to open /usr/lib/libmath.so failed
  attempt to open /usr/lib/libmath.a failed
  ld: cannot find -lmath
  </code></pre>
  
  <p><code>ld</code> doesn't even seek in <code>/home/mathieu/lib</code> path.</p>
  
  <p><code>gcc test.c -o test -lmath</code>returns</p>
  
  <pre><code>/usr/bin/ld: cannot find -lmath
  collect2: error: ld returned 1 exit status
  </code></pre>
  
  <p>Do you have a solution?</p>
  
  <p>Thanks.</p>