C++ User's Guide

-library=l[,...l]

Incorporates specified CC-provided libraries into compilation and linking.

Values

For -compat=4, l must be one of the following:

Value of l

Meaning 

[no%]rwtools7

[Do not] Use Tools.h++ v 7

[no%]rwtools7_dbg

[Do not] Use debug-enabled Tools.h++ v 7

[no%]complex

[Do not] Use libcomplex for complex arithmetic

[no%]libC

[Do not] Use libC, the C++ support library

[no%]gc

[Do not] Use libgc, garbage collection

[no%]gc_dbg

[Do not] Use debug-enabled libgc, garbage collection

%all

The same as %none, rwtools7, complex, gc, libC

%none

Use no C++ libraries 

For -compat=5, l must be one of the following:

Value of l

Meaning 

[no%]rwtools7

[Do not] Use Tools.h++ v 7

[no%]rwtools7_dbg

[Do not] Use debug-enabled Tools.h++ v 7

[no%]iostream

[Do not] Use libiostream, the classic iostreams library

[no%]Cstd

[Do not] Use libCstd, the C++ standard library

[no%]Crun

[Do not] Use libCrun, the C++ runtime library

[no%]gc

[Do not] Use libgc, garbage collection

[no%]gc_dbg

[Do not] Use debug-enabled libgc, garbage collection

%all

Same as %none, rwtools7, gc,iostream, Cstd,Crun

%none

Use no C++ libraries, except for libCrun

Defaults

For -compat=4, if -library is not specified, -library=%none,libC.The libC library always is included unless specifically excluded using -library=%none or -library=no%libC.

For -compat=5, if -library is not specified, -library=%none,Cstd,Crun.The libCstd library always is included unless specifically excluded using -library=%none or -library=no%Cstd. The libCrun library always is included unless specifically excluded using -library=no%Crun.

Examples

To link in standard mode without any C++ libraries (except libCrun), use:

demo% CC -library=%none

To include the Rogue Wave tools.h++ v7 and iostream libraries in standard mode:

demo% CC -library=rwtools7,iostream

Interactions

If a library is specified with -library, the proper -I paths are set during compilation. The proper -L,-Y P, -R paths and -l options are set during linking.

Use of the -library option ensures that the -l options for the specified libraries are emitted in the right order. For example, the -l options are passed to ld in the order -lrwtool -liostream for both -library=rwtools7,iostream and -library=iostream,rwtools7.

The specified libraries are linked before system support libraries.

Only one Rogue Wave tools library can be used at a time.

The Rogue Wave Tools.h++ version 7 library is built with classic iostreams. Therefore, when you include the Rogue Wave tools library in standard mode, you must also include libiostream.

If you include both libCstd and libiostream, you must be careful to not use the old and new forms of iostreams (for example, cout and std::cout) within a program to access the same file. Mixing standard iostreams and classic iostreams in the same program is likely to cause problems if the same file is accessed from both classic and standard iostream code.

Programs linking neither libC nor libCrun might not use all features of the C++ language.

If -xnolib is specified, -library is ignored.

Warnings

The set of libraries is not stable and might change from release to release.

See also

-I, -l, -R, -staticlib, -xnolib, "Using make With iostreams", C++ Library Reference, Tools.h++ User's Guide, Tools.h++ Class Library Reference, Standard C++ Library Reference