title: /usr/bin/ld: warning: abc.so, needed by xyz.so not found (try using -rpath or -rpath-link)"
body: <p>I am building a C++ application, using Netbeans 6.9 as my IDE. I have a C++ library which is a wrapper around a pure C library.</p>
  
  <p>I have correctly added the file to the project (using the Add Library File option). Here is the output produced by g++ and the linker:</p>
  
  <pre><code>g++  -o dist/Debug/GNU-Linux-x86/testluaembed build/Debug/GNU-Linux-x86/src/main.o build/Debug/GNU-Linux-x86/src/LuaBinding.o -L../../mainline/tanlib_core/dist/Debug/GNU-Linux-x86 -L../../mainline/tanlib++/dist/Debug/GNU-Linux-x86 -L/usr/lib ../../mainline/tanlib_core/dist/Debug/GNU-Linux-x86/libtanlib_core.so ../../mainline/tanlib++/dist/Debug/GNU-Linux-x86/libtanlibpp.so /usr/lib/liblua5.1.a /usr/lib/libtolua++5.1.a /usr/local/boost_1_45_0/stage/lib/libboost_filesystem.a /usr/local/boost_1_45_0/stage/lib/libboost_system.a 
  /usr/bin/ld: warning: libtanlib_core.so, needed by ../../mainline/tanlib++/dist/Debug/GNU-Linux-x86/libtanlibpp.so, not found (try using -rpath or -rpath-link)
  /usr/lib/liblua5.1.a(loadlib.o): In function `ll_loadfunc':
  /usr/lib/liblua5.1.a(loadlib.o): In function `ll_loadfunc':
  /usr/lib/liblua5.1.a(loadlib.o): In function `ll_loadfunc':
  /usr/lib/liblua5.1.a(loadlib.o): In function `ll_loadfunc':
  /usr/lib/liblua5.1.a(loadlib.o): In function `gctm':
  collect2: ld returned 1 exit status
  make[2]: *** [dist/Debug/GNU-Linux-x86/testluaembed] Error 1
  make[1]: *** [.build-conf] Error 2
  make: *** [.build-impl] Error 2
  </code></pre>
  
  <p>I run ldd on the C++ wrapper library and got this output:</p>
  
  <pre><code>$ldd libtanlibpp.so 
      linux-vdso.so.1 =&gt;  (0x00007fff123c0000)
      libtanlib_core.so =&gt; not found
      libstdc++.so.6 =&gt; /usr/lib/libstdc++.so.6 (0x00007fe4f0fde000)
      libm.so.6 =&gt; /lib/libm.so.6 (0x00007fe4f0d5a000)
      libgcc_s.so.1 =&gt; /lib/libgcc_s.so.1 (0x00007fe4f0b43000)
      libc.so.6 =&gt; /lib/libc.so.6 (0x00007fe4f07c0000)
      /lib64/ld-linux-x86-64.so.2 (0x00007fe4f15ee000)
  </code></pre>
  
  <p>So although the file exists on my machine, it appears it is not in my library cache. I tried using ldconfig, but the problem remains. Any ideas on how to resolve this?</p>