Searches the path directory for library files specified by the -lkey option.


Read syntax diagramSkip visual syntax diagram>>- -L--directory----------------------------------------------><


The default is to search only the standard directories.


If the LIBPATH environment variable is set, the compiler will search for libraries first in directory paths specified by LIBPATH, and then in directory paths specified by the -L compiler option.

If the -Ldirectory option is specified both in the configuration file and on the command line, search paths specified in the configuration file are the first to be searched.


To compile myprogram.c so that the directory /usr/tmp/old and all other directories specified by the -l option are searched for the library libspfiles.a, enter:

xlc myprogram.c -lspfiles -L/usr/tmp/old

Related information