Splitting .o files is necessary because when multiple libraries are built, they may each contain the same automatically assigned template instance. The splitting is somewhat slow the first time you build a library. Parallel Prelinking Prelinking is typically fast after the first complete compilation, because template instances have already been assigned and compiled. However, the first compilation of a program containing many templates can be slow because most of the .o files must be recompiled. This tells KCC to fork up to n processes for recompilation.
Some programmers find it simpler to forgo automatic instantiation altogether in libraries.
This can be done portably by using the ISO syntax for explicit instantiation and otherwise using templates only for entities with internal linkage. For example, using only inline functions in templates. Entities with internal linkage do not require prelinking, because such entities are instantiated in each .o file where required. To build the library, specify .a , .so , or .sl as the executable file. For instance, the two commands shown below build a shared library and an archive library.