DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Getting Started

Compiling and Linking with C++ Standard Components

The header files, template definition files and object library archives for C++ Standard Components are installed in the normal system directories for such files. Thus, to compile and link with C++ Standard Components, it is only necessary to specify the appropriate Standard Components archives to the CC(CP) command. There are three archives:


lib++.a
all Standard Components except fs and G2++

libfs.a
fs component

lib2g++.a
G2++ component

For example, to compile and link an application that only uses the String component:

   $ CC string_user.C -l++
To compile and link the same application for fs(C++) analysis:
   $ CC -f string_user.C -lfs -l++
(The -f option instructs the compilation system to prepare the source for fs.)

Several of the Standard Components use templates. Depending on your use of these components, you may need to specify an additional compiler option to guide template instantiation. See the topic ``Instantiating C++ templates'' for details. One choice that will work is to use automatic template instantiation. In this case, the command to compile and link an application that uses both the String and Map components would be:

   $ CC string_and_map_user.C -l++
Of course, additional CC(CP) options can be used as desired.
Next topic: Thread Safety
Previous topic: Component names and component documentation

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005