title: incorrect shared library being used at runtime for my c Program
body: <p>i have complied my program with  new version of a shared libary (vertex )
  and when i do ldd on my executable i see it is linked to correct version (STQ_8_1_ISAM)</p>
  <pre><code>ldd /pathtoexe/mytaxprg|grep vertex
          libvst.so =&gt; /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libvst.so (0x00ce8000)
          libloc.so =&gt; /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libloc.so (0x0034e000)
          libcb65.so =&gt; /usr/local/vertex/STQ_8_1_ISAM/32bit/lib/libcb65.so (0x00c15000)
  </code></pre>
  <p>but when i run the program it picks up the old library (STQ_6_0_ISAM) i can see by both gdb and lsof on the pid</p>
  <pre><code>&gt; lsof -p 2856 | grep vertex
  mytaxprg 2856   mem    REG    253,26   980508     386333 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libvst.so
  mytaxprg 2856   mem    REG    253,26    20588     386330 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libqutil.so
  mytaxprg 2856   mem    REG    253,26    62049     386334 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libloc.so
  mytaxprg 2856   mem    REG    253,26   460620     386331 /usr/local/vertex/STQ_6_0_ISAM/32bit/lib/libcb65.so
  </code></pre>
  <p>also i did <code>env|grep vertex</code> to check that i dont have old library on my path variable.</p>
  <p>/usr/local/vertex/STQ_8_1_ISAM/32bit/lib --&gt; path to new version</p>
  <pre><code>&gt; env | grep LD_LIBRARY_PATH
  LD_LIBRARY_PATH=/usr/local/vertex/STQ_8_1_ISAM/32bit/lib:/opt/mqm/lib:/usr/local/g1_4.2_gtx_7.2/g1rts/lib:/usr/local/g1_4.2_gtx_7.2/gtx/lib:/usr/local/g1_4.2_gtx_7.2/c1p/lib:/usr/local/g1_4.2_gtx_7.2/c1p/rts/lib:/usr/local/g1_4.2_gtx_7.2/gtx/stubs:/mtr/test/local_tlg/lib:/mtr/test/tlg_home/lib:/lib64:/usr/lib:/lib:/mtr/test/tlg_home/bin:/oravl01/oracle/11.2.0.4/lib32/stubs:/opt/syncsort/lib:/opt/qsel1.9_32/lib:/usr/local/icu4c-3_8_1/lib:/usr/local/icu-4.0/lib:/usr/local/vertex/commtax_3_1/32bit/lib:/usr/local/vertex/commtax_3_1/32bit/bin/odbc:/usr/local/vertex/commtax_3_1/32bit/bin/odbc/lib:/usr/java/jdk1.6.0_26_32/jre/lib/i386/server:/mtr/test/tlg_home/lib:/usr/local/axis2c/lib:/usr/local/xerces-c-2_8_0_icu/lib:/usr/local/xerces_2_8_0_32bit/lib:/ace-6.2_32b/:/opt/intel/Compiler/11.0/074/lib/ia32:/opt/intel/13.1.3_5.192/composer_xe_2013.5.192/debugger/mic/lib
  </code></pre>
  <p>how is the library loaded at runtime and what could be the cause of this problem?</p>