title: How to change the library include path of a binary from bash?
body: <p>I have a software properly installed on Kubuntu.</p>
  
  <p>Now, I am patching and testing some of its libraries.  </p>
  
  <p>How can I start the software from bash so that it loads my patched libraries instead of the official libs? </p>
  
  <p>e.g.:<br>
  the official libs are locate in /usr/lib/<br>
  my patch libraries (used during test development) are in /home/user/dev/lib/  </p>
  
  <p>I tried:  </p>
  
  <pre><code>$ set LD_LIBRARY_PATH=/home/user/dev/lib/  
  $ binary_app &amp;
  </code></pre>
  
  <p>but to no avail.  </p>
  
  <p>I'd prefer a solution that can be set from the bash, but if it's not possible, I could also modify the cmake file of this C++ software. </p>
  
  <p>The aim is to allow me to easily start the application either with the vanilla libs, or with my patched libs to see the differences. </p>
  
  <p><strong>Edit: it's a KDE .so file</strong>  </p>
  
  <p>The library I am testing is a KDE4 library. The official lib is in /usr/lib/kde4/ . In that directory, none of the library start with the <strong>lib</strong> prefix.  </p>
  
  <p>Whether I do:  </p>
  
  <pre><code>/lib/ld-linux-x86-64.so.2 --list  --library-path PATH EXEC  
  </code></pre>
  
  <p>or </p>
  
  <pre><code>ldd EXEC  
  </code></pre>
  
  <p>The library is not listed at all.  </p>
  
  <p>On the other hand, if if move the original library away from /usr/lib/kde4/, the application starts but the corresponding functionality is missing.   </p>
  
  <p>Are KDE4 libraries loaded in a specific way? Maybe the variable to set is different... </p>
  
  <p><strong>Edit 2</strong>  </p>
  
  <p>All the answers are good and useful... unfortunately, it turned out that the problem does not appear to be related to the lib path setting. I'm dealing with a plugin architecture and the .so loading path appears to be hard-coded somewhere in the application. I need to spend more time within the source code to understand what's happening... Thanks and +1 to all.</p>