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

Exit Print View

Updated: July 2016
 
 

11.2.2 Default C++ Libraries

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. In default -compat=5 mode, the following libraries are linked by default by the CC driver:

-lCstd -l Crun -lm -lc

In -std=c++03, -std=c++11, and -std=c++14 modes, the following libraries are linked by default by the CC driver:

-lstdc++ -lgcc_s -lCrunG3 -lm -lc

See –library=l[,l...] for more information.