title: In Solaris, link dynamic library error when using /usr/sfw/bin/gcc
body: <p>all:<br>
      I am working on Solaris 10, and meet the following issue:  </p>
  
  <pre><code>There is ODBC dynamic library in /usr/local/lib:
  
  lrwxrwxrwx   1 root     root          16 Jun 26  2012 libodbc.so -&gt; libodbc.so.2.0.0
  lrwxrwxrwx   1 root     root          16 Jun 26  2012 libodbc.so.2 -&gt; libodbc.so.2.0.0
  -rwxr-xr-x   1 root     root     1874776 Jun 26  2012 libodbc.so.2.0.0  
  </code></pre>
  
  <p>The makefile likes this:  </p>
  
  <pre><code>gcc  -o a a.c -lodbc
  </code></pre>
  
  <p>When I use  /usr/local/bin/gcc to complie the program, the compile is OK.<br>
    But when I use /usr/sfw/bin/gcc to complie the program, get the following error:  </p>
  
  <p>ld: fatal: library -lodbc: not found</p>
  
  <p>But crle command output:  </p>
  
  <pre><code> Configuration file [version 4]: /var/ld/ld.config  
   Platform:     32-bit MSB SPARC
   Default Library Path (ELF):   /lib:/usr/lib:/usr/local/lib:/opt/DSI/32:/usr/local/asg_mysql/lib
   Trusted Directories (ELF):    /lib/secure:/usr/lib/secure  (system default)
  
   Command line:
   crle -c /var/ld/ld.config -l /lib:/usr/lib:/usr/local/lib:/opt/DSI/32:/usr/local/asg_mysql/lib
  </code></pre>
  
  <p>It seems OK.</p>
  
  <p>So is there any difference when using gcc? Thanks very much in advance!<br>
  Best Regards<br>
  Nan Xiao</p>