Use the filename argument to specify the library that you know contains the existing template instances. The filename argument must contain a forward slash ’/’ character. For paths relative to the current directory, use dot-slash ’./’.
The -instlib=filename option has no default and is only used if you specify it. This option can be specified multiple times and accumulates.
Assume that the libfoo.a and libbar.so libraries instantiate many template instances that are shared with your source file a.cc. Adding -instlib=filename and specifying the libraries helps reduce compile time by avoiding the redundancy.
example% CC -c -instlib=./libfoo.a -instlib=./libbar.so a.cc
When you compile with -g, if the library specified with -instlib=file is not compiled with -g, those template instances will not be debuggable. The workaround is to avoid -instlib=file when you use -g.
If you specify a library with -instlib, you must link with that library.
-template, -instances, -pti