C++ User's Guide

Consistent Compiling and Linking

If you do compile and link in separate steps, consistent compiling and linking is critical when using the following compiler options:

If you compile any subprogram with any of these options, be sure to link with the same option as well:

In the following example, the programs are compiled using the -xcg92 compiler option. This option is a macro for -xtarget=ss1000 and expands to: -xarch=v8 -xchip=super -xcache=16/64/4:1024/64/1

If the program uses templates, it is possible that some templates will get instantiated at link time. In that case the command line options from last line (the link line) will be used to compile the instantiated templates.


 demo% CC -c -xcg92 sbr.cc
 demo% CC -c -xcg92 smain.cc
 demo% CC -xcg92 sbr.o smain.o