title: Loading custom dll + custom app fails with: error while loading shared libraries
body: <p>My environment is:</p>
  
  <ul>
  <li>Debian Linux 8 x86 </li>
  <li>Qt 5.3.1 installed in /opt (to avoid conflict with
  system installed Qt) </li>
  <li>QtCreator 3.4.2 </li>
  <li>gcc 4.9.2</li>
  </ul>
  
  <p>While creating my app I've decided to split some functionality into several parts. So I've created subfolder project (<code>main</code>) with 2 folders/subprojects (<code>UI</code> and <code>logics</code>), like that:</p>
  
  <ul>
  <li>main
  
  <ul>
  <li>UI </li>
  <li>logics</li>
  </ul></li>
  </ul>
  
  <p>when <code>UI</code> is default Qt Widget Application (main.cpp and window). <code>logics</code> is very simple shared library with empty class <code>Logics</code> (empty constructor and nothing else more). I've added </p>
  
  <pre><code>DESTDIR = $$PWD/../UI
  </code></pre>
  
  <p>to <code>logics.pro</code> so final <code>logics.so</code> will be created inside <code>UI</code> folder.
  to <code>UI.pro</code> i've added </p>
  
  <pre><code>LIBS += -L $$PWD -llogics
  </code></pre>
  
  <p>to link <code>UI</code> executable with <code>logics.so</code></p>
  
  <p>Now when I run executable from <code>UI</code> project with <code>QtCreator</code> I get strange error: </p>
  
  <blockquote>
    <p>UI: error while loading shared libraries: liblogics.so.1: cannot open
    shared object file: No such file or directory</p>
  </blockquote>
  
  <p>The error only exists when <code>Logics</code> class derived from <code>QObject</code>. It looks like <code>logics.so</code> cannot find <code>Qt</code> library. but when I query its dependencies I see no problem:</p>
  
  <blockquote>
    <p><em>ldd logics.so</em></p>
  
  <pre><code>    linux-gate.so.1 (0xb770d000)
      libQt5Core.so.5 =&gt; /opt/Qt5.3.1/5.3/gcc/lib/libQt5Core.so.5
      ...
  </code></pre>
  </blockquote>
  
  <p>If the <code>Logics</code> class is independed from <code>Qt</code> I mean, when I remove <code>QObject</code>, the error gone.</p>
  
  <p>But I cannot add this Qt library path to <code>LD_LIBRARY_PATH</code> just because it will conflict with system installed Qt libraries.</p>
  
  <p>So my question - how can I run my main <code>UI</code> project from QtCreator with my custom linked shared library?</p>