title: Get dynamic library directory in c++ (linux)
body: <p>Is there any programmatic way to get the location of a dynamic library loaded by a program?</p>
  
  <p>I know that it is possible to get the 'executable' running path. But it is not enough for me.</p>
  
  <p>I'm developing an external library that has some dependencies and I need to point accordingly to its location.</p>
  
  <p>For example, the program is running at:</p>
  
  <pre><code>/local/deepLearning/bin
  </code></pre>
  
  <p>And this program uses a dynamic library located at:</p>
  
  <pre><code>/local/external/libs/faciesAnalysis
  </code></pre>
  
  <p>What I need is, at runtime, the string </p>
  
  <pre><code>"/local/external/libs/facesAnalysis"
  </code></pre>
  
  <p>I am working on linux, any suggestion?</p>