Sun Studio 12: C++ User's Guide

A.2.34 –h[ ]name

Assigns the name name to the generated dynamic shared library.

This is a loader option, passed to ld. In general, the name after -h should be exactly the same as the one after –o. A space between the –h and name is optional.

The compile-time loader assigns the specified name to the shared dynamic library you are creating. It records the name in the library file as the intrinsic name of the library. If there is no –hname option, then no intrinsic name is recorded in the library file.

Every executable file has a list of shared library files that are needed. When the runtime linker links the library into an executable file, the linker copies the intrinsic name from the library into that list of needed shared library files. If there is no intrinsic name of a shared library, then the linker copies the path of the shared library file instead.

A.2.34.1 Examples


example% CC -G -o libx.so.1 -h libx.so.1 a.o b.o c.o