I have a simple test case I am using to see how I can get custom shared libraries called from a user oct-file. I have GNU Octave, version 2.1.57 (i686-pc-linux-gnu). I used configure --enable-shared before I installed. I also have successfully installed octave-forge octave-forge-2004.07.07. I am using RedHat Linux 9. After compiling I installed libshare.so.1.0.1 and made appropriate links in /usr/local/lib.
I tested the libshare.so library with a stand-alone app and it worked fine. When I run the octshare command in the directory containing the octshare.oct file in octave I get the following output.