C++ User's Guide

Interactions

To link the C++ default libraries statically, use the -staticlib option.

This option affects the linking of libraries provided by default. To ensure that default libraries are linked dynamically, the last use of -B should be -Bdynamic.