Keil Logo

NODEFAULTLIBRARY Linker Directive

Abbreviation

NLIB

Arguments

None.

Default

C run-time libraries are included in the linkage.

µVision

Options — L251 Misc — Misc Controls.

Description

The NODEFAULTLIBRARY directive disables automatic linkage with the C run-time libraries. By default, the linker includes required run-time libraries (based on memory model and floating-point usage).

These libraries appear as follows in the linker map file.

INPUT MODULES INCLUDED:
 C:\KEIL\C251\LIB\C251S.LIB (?C_STARTUP)
     COMMENT TYPE 128: A251 V3.00
 C:\KEIL\C251\LIB\C251S.LIB (PRINTF)
     COMMENT TYPE 128: A251 V3.00

If NODEFAULTLIBRARY is used, C run-time libraries must be manually included in the linkage. For example:

L251 inputlist, CxxFPS.LIB, CxxS.LIB NODEFAULTLIBRARY

This example includes the SMALL memory model library (CxxS.LIB) and the SMALL floating-point library (CxxFPS.LIB). If the program contains no floating-point math operations CxxFPS.LIB should not be included in the linkage.

Note

  • The C251LIB environment variable specifies the location of library files. Typically, this is set to \KEIL\C251\LIB but you may change it using the DOS SET command. The linker looks in this folder for the C run-time libraries. If you use the µVision IDE, the location of the run-time libraries is set automatically. You may change it in the Project — File Extensions, Books, and Environment dialog.
  • If no environment variable is set, the linker searches for libraries in exepath/../LIB which corresponds to the location for library files in a default installation.
Example
L251 file1.obj NODEFAULTLIBRARY
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.