title: When I include a shared library, my executable is looking for two versions of it
body: <p>When I make my program with <code>-larmadillo</code>, I get an executable which wants two versions of it:</p>
  
  <pre><code>$ ldd ./a.out | grep armadillo 
  $ libarmadillo.so.7 =&gt; /usr/lib/x86_64-linux-gnu/libarmadillo.so.7 (0x00007fd5e29a0000)
  $ libarmadillo.so.4 =&gt; not found
  </code></pre>
  
  <p>Can anyone point me in the right direction? This isn't making any sense to me!</p>
  
  <p>Background: I initially installed libarmadillo via <code>sudo apt-get install libarmadillo-dev</code>, then I realised I needed to build it with a specific parameter (64 bit words enabled), so I uninstalled it via <code>sudo apt-get remove libarmadillo-dev</code> then downloaded the latest version, configured and make/make installed it. Presumably I only have one version of libarmadillo on my system - I do not see any old libraries in the usual places.</p>
  
  <p>Thanks </p>
  
  <p>EDIT:</p>
  
  <p>My Makefile is:</p>
  
  <pre><code>CC= g++
  CFLAGS= -Lcontrib/armadillo-7.400.1 -L/usr/include -Lcontrib/mlpack-2.0.1/build/lib -fpermissive -std=c++11 -O0 -g -Wall
  LDFLAGS= -lmlpack -larmadillo
  </code></pre>
  
  <p>The verbose output of ldd is interesting, I think? </p>
  
  <pre><code>$ ldd -v ./a.out | grep armadillo 
  $ libarmadillo.so.7 =&gt; /usr/lib/x86_64-linux-gnu/libarmadillo.so.7 (0x00007fd5e29a0000)
  $ libarmadillo.so.4 =&gt; not found
  $ /usr/lib/x86_64-linux-gnu/libarmadillo.so.7:
  </code></pre>
  
  <p>The latter section (which lists dependences for libarmadillo.so.7) is:</p>
  
  <pre><code>/usr/lib/x86_64-linux-gnu/libarmadillo.so.7:
      ld-linux-x86-64.so.2 (GLIBC_2.3) =&gt; /lib64/ld-linux-x86-64.so.2
      libc.so.6 (GLIBC_2.2.5) =&gt; /lib/x86_64-linux-gnu/libc.so.6
  </code></pre>
  
  <p>There is no mention of the 'missing' libarmadillo.so.4 in the verbose output, which I find quite strange.</p>