C++ User's Guide

Library Options

The following library linking options are listed in alphabetical order.

Action 

Option 

Details  

Allows dynamic static library linking. 

-Bbinding

"-Bbinding"

Allows or disallows dynamic libraries for the entire executable. 

-d(y|n)

"-d(y|n)"

Builds a dynamic shared library instead of an executable file. 

-G

"-G"

Assigns a name to the generated dynamic shared library.

-hname

"-hname"

Tells ld(1) to ignore any LD_LIBRARY_PATH setting.

-i

"-i"

Adds dir to the list of directories to be searched for libraries.

-Ldir

"-Ldir"

Adds liblib.a or liblib.so to the linker's library search list.

-llib

"-llib"

Forces inclusion of specific libraries and associated files into compilation and linking. 

-library=llst

"-library=l[,...l]"

Compiles and links for multithreaded code. 

-mt

"-mt"

Does not build path for libraries into executable. 

-norunpath

"-norunpath"

Builds dynamic library search paths into the executable file. 

-R pathname

"-Rpathname"

Indicates which C++ libraries are to be linked statically. 

-staticlib=llst

"-staticlib=l[,...l]"

Creates archive libraries. 

-xar

"-xar"

Causes libm to return IEEE 754 values for math routines in exceptional cases.

-xlibmieee

"-xlibmieee"

Inlines selected libm library routines for optimization.

-xlibmil

"-xlibmil"

Uses library of optimized math routines. 

-xlibmopt

"-xlibmopt"

Links with the specified, Sun-supplied, licensed libraries. 

-xlic_lib=llst

"-xlic_lib=l[,...l]"

Disables linking with default system libraries. 

-xnolib

"-xnolib"

Cancels -xlibmil on the command line.

-xnolibmil

"-xnolibmil"

Does not use the math routine library. 

-xnolibmopt

"-xnolibmopt"

Forces fatal error if relocations remain against non-writable, allocatable sections. 

-ztext

"-ztext"