The standard library search paths used by the linker are determined by the installation path, and they differ for static and dynamic loading. A standard install puts the Sun Studio compiler software under /opt/SUNWspro/.
While building the executable file, the static linker searches for any libraries in the following paths (among others), in the specified order:
/opt/SUNWspro/lib |
Sun Studio shared libraries |
/usr/ccs/lib/ |
Standard location for SVr4 software |
/usr/lib |
Standard location for UNIX software |
These are the default paths used by the linker.
The dynamic linker searches for shared libraries at runtime, in the specified order:
Paths specified by user with -Rpath
/opt/SUNWspro/lib/
/usr/lib standard UNIX default
The search paths are built into the executable.