title: "cannot open shared object file," but it exists
body: <p>I'm having trouble finding why this library (matio) isn't working for me. In my Makefile I have this:</p>
  
  <pre><code>LIBS += -L/home/brian/.../matio-1.5.6/src/.libs/ -lmatio
  </code></pre>
  
  <p>When I attempt to run my code (links fine) I get this error:</p>
  
  <blockquote>
    <p>error while loading shared libraries: libmatio.so.4: cannot open shared object file: No such file or directory</p>
  </blockquote>
  
  <p>libmatio.so.4 exists in the directory specified by the -L flag.</p>
  
  <p>I built the library and it seems to go through <code>make check</code> with only a handful writing errors (which is fine as I only need it for reading).</p>
  
  <p>Things I've tried:</p>
  
  <ul>
  <li>Specifying the name (i.e. <code>-l:libmatio.so.4.0.2</code>)</li>
  <li>Adding the path to <code>LD_LIBRARY_PATH</code></li>
  <li>Adding the path as a line in <code>/etc/ld.so.conf</code> and run <code>sudo ldconfig</code></li>
  <li>Adding a new file in <code>/etc/ld.so.conf.d</code> with the path and run <code>sudo ldconfig</code></li>
  </ul>
  
  <p>(When I run <code>ldconfig -p | grep matio</code> nothing returns. Am I doing something wrong with <code>ldconfig</code>?)</p>