-qlib, -nodefaultlibs (-qnolib)
Category
Pragma equivalent
None.
Purpose
Specifies whether standard system libraries and XL C/C++ libraries are to be linked.
When -qlib is in effect, the standard system libraries and compiler libraries are automatically linked. When -nodefaultlibs (-qnolib) is in effect, the standard system libraries and compiler libraries are not used at link time; only the libraries specified on the command line with the -l flag will be linked.
This option can be used in system programming to disable the automatic linking of unneeded libraries.
Syntax
>>- -nodefaultlibs---------------------------------------------><
.-lib---. >>- -q--+-nolib-+----------------------------------------------><
Defaults
-qlibUsage
Using -nodefaultlibs (-qnolib) specifies that no libraries, including the system libraries as well as the XL C/C++ libraries (these are found in the lib/ and lib64/ subdirectories of the compiler installation directory), are to be linked. The system startup files are still linked, unless -nostartfiles (-qnocrt) is also specified.
Predefined macros
None.
Examples
xlc myprogram.c -nodefaultlibs -lxlopt