Keil Logo Arm Logo

LARM User's Guide

Discontinued

NODEFAULTLIBRARY Linker Directive

Abbreviation

NLIB

Arguments

None.

Default

C run-time libraries are included in the linkage.

µVision

Options — L166L251BL51LX51LA 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\C166\LIB\C166S.LIB (?C_STARTUP)
     COMMENT TYPE 128: A166 V5.00
 C:\KEIL\C166\LIB\C166S.LIB (PRINTF)
     COMMENT TYPE 128: A166 V5.00

These libraries appear as follows in the linker map file.

INPUT MODULES INCLUDED:
 C:\KEIL\C51\LIB\C51S.LIB (?C_STARTUP)
     COMMENT TYPE 128: A51 V7.00
 C:\KEIL\C51\LIB\C51S.LIB (PRINTF)
     COMMENT TYPE 128: A51 V7.00

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:

L166L251BL51LX51LA 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 C166LIB environment variable specifies the location of library files. Typically, this is set to \KEIL\C166\LIB but you may change it using the DOS SET command. The C51LIB environment variable specifies the location of library files. Typically, this is set to \KEIL\C51\LIB but you may change it using the DOS SET command. 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
L166L251BL51LX51LA file1.obj NODEFAULTLIBRARY

Keil logo

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.