Go to main content
Oracle® Developer Studio 12.6: C++ User's Guide

Exit Print View

Updated: July 2017

11.1 C Libraries

The Oracle Solaris operating system comes with several libraries installed in /usr/lib. Most of these libraries have a C interface. Of these, the libc and libm, libraries are linked by the CC driver by default. The library libthread is linked if you use the -mt option. To link any other system library, use the appropriate -l option at link time. For example, to link the libdemangle library, pass –ldemangle on the CC command line at link time:

example% CC text.c -ldemangle

Note -  libatomic is available on certain versions of Oracle Solaris and Linux in /usr/lib. Note that –latomic does not link the system library libatomic. See -xatomic=a and Oracle Developer Studio 12.6: Release Notes for more information.

The C++ compiler has its own runtime support libraries. All C++ applications are linked to these libraries by the CC driver. The C++ compiler also comes with several other useful libraries, as explained in the following section.