Sun Studio 12: C++ User's Guide

2.3 Compiling With Different Compiler Versions

Beginning with the C++ 5.1 compiler, the compiler marks a template cache directory with a string that identifies the template cache’s version.

This compiler does not use the cache by default. It only uses the cache if you specify -instances=extern. If the compiler makes use of the cache, it checks the cache directory’s version and issues error messages whenever it encounters cache version problems. Future C++ compilers will also check cache versions. For example, a future compiler that has a different template cache version identification and that processes a cache directory produced by this release of the compiler might issue an error that is similar to the following message:


Template Database at ./SunWS_cache is incompatible with
this compiler

Similarly, the compiler issues an error if it encounters a cache directory that was produced by a later version of the compiler.

Although the template cache directories produced by the C++ 5.0 compiler are not marked with version identifiers, the current compiler processes the 5.0 cache directories without an error or a warning. The compiler converts the 5.0 cache directories to the directory format that it uses.

The C++ 5.0 compiler cannot use a cache directory that is produced by a later release of the compiler. The C++ 5.0 compiler is not capable of recognizing format differences and it will issue an assertion when it encounters a cache directory that is produced by the C++ 5.1 compiler or by a later release.

When you upgrade your compiler, it is always good practice to clean the cache. Run CCadmin -clean on every directory that contains a template cache directory (in most cases, a template cache directory is named SunWS_cache). Alternatively, you can use rm -rf SunWS_cache.