Using the -qtemplateregistry compiler option

Unlike -qtempinc, the -qtemplateregistry compiler option does not impose specific requirements on the organization of your source code. Any program that compiles successfully with -qnotempinc will compile with -qtemplateregistry.

The template registry uses a "first-come first-served" algorithm:

The instantiation information is stored in a template registry file. You must use the same template registry file for the entire program. Two programs cannot share a template registry file.

The default file name for the template registry file is templateregistry, but you can specify any other valid file name to override this default. When cleaning your program build environment before starting a fresh or scratch build, you must delete the registry file along with the old object files.

Recompiling related compilation units

If two compilation units, A and B, reference the same instantiation, the -qtemplateregistry compiler option has the following effect:

Switching from -qtempinc to -qtemplateregistry

Because the -qtemplateregistry compiler option does not impose any restrictions on the file structure of your application, it has less administrative overhead than -qtempinc. You can make the switch as follows:

IBM Copyright 2003