Several libraries are shipped with the C++ compiler. Some of these libraries are available only in compatibility mode (-compat=4), some are available only in the standard mode (-compat=5), and some in both modes. The libgc and libdemangle libraries have a C interface and can be linked to an application in either mode.
The following table lists the libraries shipped with the C++ compiler and the modes in which they are available.
Library |
Description |
Available Mode (s) |
---|---|---|
libCrun |
C++ runtime |
-compat=5 |
libCstd |
C++ Standard Library |
-compat=5 |
libiostream |
Classic iostreams |
-compat=5 |
libC |
C++ runtime, classic iostreams |
-compat=4 |
libC_mtstubs |
mtstubs library |
-compat=4, -compat=5 |
libcomplex |
complex library |
-compat=4 |
librwtool |
Tools.h++ 7 |
-compat=4, -compat=5 |
librwtool_dbg |
Debug-enabled Tools.h++ 7 |
-compat=5 |
libgc |
Garbage collection |
C interface |
libgc_dbg |
Debug-enabled garbage collection |
-compat=4, -compat=5 |
libdemangle |
Demangling |
C interface |
A brief description of each of these libraries follows.
libCrun: This library contains the runtime support needed by the compiler in the standard mode (-compat=5). It provides support for new/delete, exceptions, and RTTI.
libCstd: This is the C++ Standard Library. In particular, it includes iostreams. If you have existing sources that use the classic iostreams and you want to make use of the standard iostreams, you have to modify your sources to conform to the new interface. See the C++ Standard Library Reference manual for details.
libiostream: This is the classic iostreams library built with -compat=5. If you have existing sources that use the classic iostreams and you want to compile these sources with the standard mode (-compat=5), you can use libiostream without modifying your sources. Use -library=iostream to get this library.
libC: This is the library needed in compatibility mode (-compat=4). It contains the C++ runtime support as well as the classic iostreams.
libC_mtstubs: This library contains stubs of some libthread functions. It gets linked in for single threaded applications. If you build your application with the -mt option, libthread gets linked in place of libC_mtstubs.
libcomplex: This library provides complex arithmetic in compatibility mode (-compat=4). In the standard mode, the complex arithmetic functionality is available in libCstd.
librwtool: (Tools.h++ 7) This is Rogue Wave's Tools.h++ version 7 library.
libgc: This is the garbage collection library (a component of Sun WorkShop Memory Monitor). For further details about this library, point your web browser to the file:
/opt/SUNWspro/SC5.0/htmldocs/locale/C/gc/start.html
If you installed the compiler in a different directory, point your browser to:
install-directory/SC5.0/htmldocs/locale/C/gc/start.html
libdemangle: This library is used for demangling C++ mangled names.
Some of the C++ libraries are linked by default by the CC driver, while others need to be linked explicitly. In the standard mode, the following libraries are linked by default by the CC driver:-lCstd -lCrun -lC_mtstubs -lm -lw -lcx -lc
In compatibility mode, the following libraries are linked by default:-lC -lC_mtstubs -lm -lw -lcx -lc
See "-library=l[,...l]" for more information.