title: How to define where libs are loaded from
body: <p>I am trying to compile omniORB on AIX 6.1 with gcc 4.2.0.</p>
  
  <p>The initialization does not work as it is picking up the non pthreaded library.</p>
  
  <p>If I set LIBPATH to /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/ omniNames will not work, as the streams interface gives an exception.</p>
  
  <p>Setting the LIBPATH to /opt/freeware/lib/gcc/powerpc-ibm-aix6.1.0.0/4.2.0/pthread seems to work, but other non pthreaded programs will pick up the pthreaded lib which may cause problems...</p>
  
  <p>The link looks like this:</p>
  
  <pre><code>g++ -o omniNames -O2 -Wall -Wno-unused -fexceptions -Wl,-brtl -Wl,-blibpath:/lib:/usr/lib:/opt/dbx/omniORB-4/lib -L../../../lib -L../../../../lib omniNames.o NamingContext_i.o log.o omniNamesWin.o -lomniORB4-ar -lomnithread34 -lpthreads
  </code></pre>
  
  <p>How do I resolve this ??</p>
  
  <p>Note that I have tried to change libpath using configure arguments but without success.</p>