title: TCL load error can't load file libfoo.so
body: <p>I am trying to load a simple TCL extension, but I keep getting the following error:</p>
  
  <pre>
  couldn't load file "libfoo.so": ld.so.1: tclsh8.4_64: fatal: libfoo.so: open failed: No such file or directory
  </pre>
  
  <p>I am using the example from <a href="http://www.tcl.tk/man/tcl8.5/TclCmd/load.htm" rel="nofollow">TCL man page</a>
  but I am not sure what I doing wrong here. I am compiling the library on Solaris using:</p>
  
  <pre>
  cc -KPIC -c -I/opt/external/tcl-8.5.8/include foo.c
  cc -shared -R/opt/external/tcl-8.5.8/i386/lib -L/opt/external/tcl-8.5.8/i386/lib -o libfoo.so foo.o
  </pre>
  
  <p>Could someone please advise on how to debug the issue?</p>