On Sun, Jun 11, 2006 at 02:35:06AM -0400, Andrew Pendleton wrote:
> I'm trying to get Sqlite 3.3.6 working on Solaris 2.8/Sparc, and I'm having
> some trouble.  After some tweaks to the configure script, I finally got the
> thing to build, but now that it's installed, when I try to run it, it
> complains that it can't find libgcc_s.so.1.  This file is in /usr/local/lib
> on the machine in question.  It seems it has no problem finding .so files in
> /lib or /usr/lib, but unfortunately, I don't have root on this machine, so I
> can't just create a symlink to fix the issue.  Adding LD_LIBRARY_PATH before
> executing sqlite3 fixes the problem temporarily, but won't work for me,
> really, as I'll be loading the .so into other programs, and won't always be
> able to tinker with environmental variables.  I've tried a number of things,
> including setting LD_LIBRARY_PATH both before the configure and before the
> make, setting CC to "gcc -L/usr/local/lib", setting LDFLAGS to
> "-L/usr/local/lib", and editing libtool to include /usr/local/lib in the
> compile-time search path and the runtime search path.  Nothing seems to
> solve the problem.  Please help!  I've been banging my head against the wall
> for the last couple of hours trying to get this thing to work, and I'm so
> close, but just can't get it to look in the right place for the shared
> object.  What's the proper way to fix this?

You need to add "-R /usr/local/lib" before the -L option.  If you run the
command
        $ ldd sqlite3
you will see a list of all the libraries sqlite3 will want to link to. For
example

        $ ldd  ./sqlite3
        librt.so.1 =>    /lib/librt.so.1
        libsqlite3.so.0 =>       /home/zzassgl/lib/libsqlite3.so.0
        libreadline.so.4 =>      /opt/sfw/lib/libreadline.so.4
        libncurses.so.5 =>       /opt/sfw/lib/libncurses.so.5
        libc.so.1 =>     /lib/libc.so.1
        libaio.so.1 =>   /lib/libaio.so.1
        libmd5.so.1 =>   /lib/libmd5.so.1
        libgcc_s.so.1 =>         /usr/sfw/lib/libgcc_s.so.1
        libgcc_s.so.1 =>         /opt/sfw/lib//libgcc_s.so.1
        libm.so.2 =>     /lib/libm.so.2

In my case, I build sqlite3 using Suns release of the gcc compilers and all
the libraries can be found.  You will probably see at least one missing
target library.

By adding -R path, you are telling the binary where to find the missing
library at compile time rather than waiting till run time.  

-- 
Geoff Lane

Taglines that make you go "Hmmm..."

Reply via email to