SUMMARY: Library link in Solaris

From: Bousquet Francois <>
Date: Fri Aug 13 2004 - 14:54:31 EDT
After a lot of response from many people, here is my summary :

First of all, the use of LD_LIBRARY_PATH is not a good idea, because if you
compile with it, you will have to use it at runtime.  It may be easy for
simple application with startup script but it gets complicated with shared
lib.  So, bottom line don't use it.

crle is a good option because it sets the LD_LIBRARY_PATH globally on
Solaris like /etc/ on Linux.  However it does not seems to be
available on Solaris 7 (not on my release !) but may be available in next
versions (Solaris 8 and over)

The best way is to set linking parameter at compile time.  In the LDFLAGS
variable, set -L for link during compile time dans -R for runtime, like this
the library will be link (like static).

A classic configure should then look like this :

env CPPFLAGS="-I/usr/local/ssl/include -I/usr/local/BerkeleyDB.4.2/include"
LDFLAGS="-L/usr/local/ssl/lib -L/usr/local/BerkeleyDB.4.2/lib
-R/usr/local/ssl/lib -R/usr/local/BerkeleyDB.4.2/lib" ./configure --prefix
/soft/openldap_static --enable-rlookups=no

Thanks everyone for your help

- Francois

-----Original Message-----
From: Bousquet Francois 
Sent: August 12, 2004 2:32 PM
To: Mailing List - SunManagers (E-mail)
Subject: Library link in Solaris

I have a library : /usr/lib/security/

This library is linked to other (libssl, libcrypto)

When I compiled it, I used CPPFLAGS, LDFLAGS and LD_LIBRARY_PATH to make it
compile succesfully.  Now, the problem I am facing is that when I do a "ldd"
command on it here the output :

bash-2.03$ ldd =>     /usr/lib/ =>      /soft/openldap/lib/ =>      /soft/openldap/lib/ =>   /usr/lib/ =>       /usr/lib/ =>        /usr/lib/ =>   /usr/lib/ =>    /usr/lib/ =>   /usr/lib/ =>        /usr/lib/ =>       (file not found) =>    (file not found) =>    /usr/lib/

You will notive that it can't found libssl and libcrypto because they are in
/usr/local/ssl/lib not /usr/lib.

If I set LD_LIBRARY_PATH with /usr/local/ssl/lib "ldd" will find all

I am currently having problem making pam_ldap working and I suppose the
problem is coming from the non-presence of a LD_LIBRARY_PATH correctly set.

There is no /etc/ in Solaris like Linux, how can I told the kernel
to lookup for particular libraries ?
sunmanagers mailing list
Received on Fri Aug 13 14:54:23 2004

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:36 EST