|Skip Navigation Links|
|Exit Print View|
|Oracle Solaris Studio 12.3: C++ User's Guide Oracle Solaris Studio 12.3 Information Library|
The following table lists the libraries that are shipped with the C++ compiler and the modes in which they are available.
Table 11-1 Libraries Shipped With the C++ Compiler
Note - Do not redefine or modify any of the configuration macros for STLport, Rogue Wave, or Oracle Solaris Studio C++ libraries. The libraries are configured and built in a way that works with the C++ compiler. libCstd and Tools.h++ are configured to interoperate so modifying the configuration macros results in programs that will not compile, will not link, or do not run properly.
This section provides a brief description of each of the C++ libraries.
libCrun – Contains the runtime support needed by the compiler in the default standard mode (-compat=5). It provides support for new/delete, exceptions, and RTTI.
libCstd – The C++ standard library. In particular, this library 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 online manual for details.
libiostream – 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.
Note - Much of the standard library depends on using standard iostreams. Using classic iostreams in the same program can cause problems.
libstlport – The STLport implementation of the C++ standard library. You can use this library instead of the default libCstd by specifying the option -library=stlport4. However, you cannot use libstlport and libCstd in the same program. You must compile and link everything, including imported libraries, using one library or the other exclusively.
librwtool (Tools.h++) – A C++ foundation class library from RogueWave. Version 7 is provided. This library is obsolete and use of the library is deprecated in new code. It is provided to accommodate programs written for C++ 4.2 that used RW Tools.h++.
libgc – Used in deployment mode or garbage collection mode. Simply linking with the libgc library automatically and permanently fixes a program’s memory leaks. When you link your program with the libgc library, you can program without calling free or delete while otherwise programming normally. The garbage collection library has a dependency on the dynamic load library so specify -lgc and -ldl when you link your program.
Additional information can be found in the gcFixPrematureFrees(3) and gcInitialize(3) man pages.
libdemangle – Used for demangling C++ mangled names.
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
The C++ libraries are linked by default when building an executable program, but not when building a shared library (.so). When building a shared library, all needed libraries must be listed explicitly. The -zdefs option will cause the linker to complain if a needed library is omitted, and is the default when building an executable program.. The following libraries are linked by default by the CC driver:
See A.2.49 -library=l[,l...] for more information.