Sun Studio 12: C++ User's Guide

A.2.46 –llib

Adds library liblib.a or liblib.so to the linker’s list of search libraries.

This option is passed to ld. Normal libraries have names such as liblib.a or liblib.so, where the lib and .a or .so parts are required. You should specify the lib part with this option. Put as many libraries as you want on a single command line; they are searched in the order specified with –Ldir.

Use this option after your object file name.

A.2.46.1 Interactions

This option accumulates instead of overrides.

It is always safer to put –lx after the list of sources and objects to insure that libraries are searched in the correct order.

Warnings

To ensure proper library linking order, you must use -mt, rather than -lthread, to link with libthread.

See also

–Ldir, -mt, 11.4.8 An Example Application, and Tools.h++ Class Library Reference