title: error while loading shared libraries
body: <p>Thank you guys answering my previous problem on <a href="https://stackoverflow.com/questions/7433984/undefined-reference-to-function-declared-in-h-file-c-language">undefined reference to function</a>. As you suggested, the reason under the problem is not linking the libraries. Now I have generated the executable file with: (the version of my g++ and gcc is 4.4.5. I am using Ubuntu 10.10.)</p>
  
  <pre><code>g++ -o ex_addinst  ./ex_addinst.o -L/home/li/work/tools/lindo/lindoapi/bin/linux64 -m64 -llindo64  -lmosek64 -lconsub3 -lc -ldl -lm -lguide -lpthread -lsvml -limf -lirc
  </code></pre>
  
  <p>But there comes <strong>another problem</strong>, when I run the executable file with </p>
  
  <pre><code>./ex_addinst
  </code></pre>
  
  <p>errors appear: (I am not sure I should start a new problem or not currently....)</p>
  
  <pre><code>./ex_addinst: error while loading shared libraries: liblindo64.so.6.0: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>But liblindo64.so.6.0 exists in the folder of the lib ~/lindoapi/bin/linux64 which contains following files:</p>
  
  <pre><code>libconsub3.so  libirc.so          liblindojni.so        libmosek64.so.5.0  lindo.par
  libguide.so    liblindo64.so      liblindojni.so.6.0.3  libsvml.so         placeholder
  libimf.so      liblindo64.so.6.0  libmosek64.so         lindoapivars.sh    runlindo
  </code></pre>
  
  <p>I have created a symbolic link between liblindo.so.6.0 and liblindo.so:</p>
  
  <pre><code>ln -sf liblindo64.so.6.0 liblindo64.so
  </code></pre>
  
  <p>There is '-llindo64' is the g++ command, so I thought  <strong>liblindo64.so.6.0</strong> should have been linked.
  I have tried to change -L to -Llib, but doesn't help.</p>
  
  <p>Can anyone tell me what is wrong here? Thanks!</p>