Sun Studio 12: C++ User's Guide

12.2 Libraries Provided With the C++ Compiler

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 are available 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 that are shipped with the C++ compiler and the modes in which they are available.

Table 12–1 Libraries Shipped With the C++ Compiler

Library 

Description 

Available Modes 

libstlport

STLport implementation of the standard library. 

–compat=5

libstlport_dbg

STLport library for debug mode 

–compat=5

libCrun

C++ runtime 

–compat=5

libCstd

C++ standard library 

–compat=5

libiostream

Classic iostreams

–compat=5

libC

C++ runtime, classic iostreams

–compat=4

libcsunimath

Supports the -xia option

–compat=5

libcomplex

complex library

–compat=4

librwtool

Tools.h++ 7

–compat=4,– compat=5

librwtool_dbg

Debug-enabled Tools.h++ 7

–compat=4,–compat=5

libgc

Garbage collection 

C interface 

libdemangle

Demangling 

C interface 


Note –

Do not redefine or modify any of the configuration macros for STLport, Rogue Wave or Sun Microsystems C++ libraries. The libraries are configured and built in a way that works with the C++ compiler. libCstd and Tool.h++ are configured to inter-operate so modifying the configuration macros results in programs that will not compile, will not link, or do not run properly.


12.2.1 C++ Library Descriptions

A brief description of each of these libraries follows.


file:/opt/SUNWspro/docs/index.html

If your compiler software is not installed in the /opt directory, ask your system administrator for the equivalent path on your system.

12.2.2 Accessing the C++ Library Man Pages

The man pages associated with the libraries described in this section are located in:

To access these man pages, ensure that your MANPATH includes /opt/SUNWspro/man (or the equivalent path on your system for the compiler software).

To access man pages for the C++ libraries, type:


example% man library-name

To access man pages for version 4.2 of the C++ libraries, type:


example% man -s 3CC4 library-name

You can also access the man pages by pointing your browser to:


file:/opt/SUNWspro/docs/index.html

12.2.3 Default C++ Libraries

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 -lm -lc

In compatibility mode (-compat), the following libraries are linked by default:

-lC -lm -lc

See A.2.49 -library=l[,l...] for more information.