title: How to load extra libraries for GDB?
body: <p>I'm trying to debug a CUDA program, but when I'm launching <code>gdb</code> like so:</p>
  
  <pre><code>$ gdb -i=mi &lt;program name&gt;
  $ r &lt;program arguments&gt;
  </code></pre>
  
  <p>I'm getting:</p>
  
  <pre><code>/home/wvxvw/Projects/cuda/exercise-1-udacity/cs344/HW2/hw: 
  error while loading shared libraries: libcudart.so.5.0: 
  cannot open shared object file: No such file or directory
  
  Process gdb-inferior killed
  </code></pre>
  
  <p><em>(formatted for readability)</em></p>
  
  <p>(I'm running gdb using <kbd>M-x</kbd><code>gdb</code>) If that matters, then CUDA libraries are in the <code>.bashrc</code></p>
  
  <pre><code>export PATH="/usr/local/cuda/bin:$PATH"
  export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64"
  </code></pre>