Sun Studio 12: C++ User's Guide

A.2.10.1 Values

Value 

Meaning  

-dy

Specifies dynamic linking in the link editor. 

–dn

Specifies static linking in the link editor. 

Defaults

If no -d option is specified, –dy is assumed.

Interactions

In a 64-bit environment, many system libraries are available only as shared dynamic libraries. These include libm.so and libc.so (libm.a and libc.a are not provided). As a result, -Bstatic and -dn may cause linking errors in 64-bit Solaris operating systems. Applications must link with the dynamic libraries in these cases.

Warnings

This option causes fatal errors if you use it in combination with dynamic libraries. Most system libraries are only available as dynamic libraries.

See also

ld(1), Linker and Libraries Guide