Oracle® Solaris Studio 12.4: Overview

Exit Print View

Updated: December 2014
 
 

C++ Compiler

The Oracle Solaris Studio C++ compiler (CC) supports the ISO International Standard for C++, ISO/IEC 14882:2011, Programming Language — C++ and ISO International Standard for C++, ISO IS 14822:2003, Programming Language — C++. The CC compiler also supports the OpenMP 4.0 shared-memory parallelism API. The OpenMP 4.0 API is included with Oracle Solaris Studio 12.4.

For specific information about C++11 support, see Support for the C++11 Standard in What’s New in Oracle Solaris Studio 12.4 .

The C++ compiler (CC) produces code that is targeted for specific operating systems, processors, architectures, memory models (32-bit and 64-bit), floating-point arithmetic, and more, according to command-line options you specify. The compiler automatically parallelizes serial source code to produce binaries with better performance on multicore systems and can also prepare binaries for enhanced debugging or analysis by other Oracle Solaris Studio tools. The compiler also supports GNU C/C++ compatibility features.

The C++ compiler consists of a front end, optimizer, code generator, assembler, template prelinker, and link editor. The CC command invokes each of these components automatically unless you use command-line options to specify otherwise.

CC Command Syntax

The syntax of the CC command is:

CC [compiler-options] source-files [-Ldir] [-l library]...

You can type CC -flags to see short descriptions of all the possible CC compiler options.

The source file names can end in .c, .C, .cc, .cxx, .c++, .cpp, or .i. Files whose names do not end with one of these suffixes are treated as object files or libraries and are handed over to the link editor.

Following the source file names, you can optionally specify the –Ldir option to add directories to the list that the linker searches for libraries, and the–llibrary option to add object libraries to the linker's list of search libraries. The –L option must precede the associated library on the command line.

By default, the files are compiled and linked in the order given to produce an output file named a.out. You can use the –o filename option to specify a different executable name. You can use the –c option to compile a source file and produce an object (.o) file, but suppress linking.

To compile a source file named test.C and produce an executable file named a.out:

% CC test.c

To compile the two source files test1.c and test2.C separately and then link them into an executable file called test:

% CC -c test1.c
% CC -c test2.C
% CC -o test test1.o test2.o

C++ Documentation

For complete information about using the C++ compiler , and the CC command and its options, see the Oracle Solaris Studio 12.4: C++ User’s Guide and the CC(1) man page. For information about the new and changed features, see What’s New in Oracle Solaris Studio 12.4 . For information about problems and workarounds, and limitations and incompatibilities of the compiler, see Oracle Solaris Studio 12.4: Release Notes .