|
|
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(1C++) command. There are three archives:
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(3C++) 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 chapter Instantiating C++ Templates in the book Programming in Standard C and C++ 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(1C++) options can be used as desired.