Keil Logo

BL51: UNRESOLVED SYMBOL ?C_STARTUP


Information in this article applies to:

  • C51 All Versions

SYMPTOMS

When writing single-file projects using in-line assembly, the linker produces the following warning:

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
     SYMBOL:    ?C_STARTUP
     MODULE:    main.obj    (MAIN)

For example, the following program:

#include <reg52.h>

void main()  {
  unsigned char i;
  unsigned char cur[20];

  for( i = 0; i < 20; i++)  {
    #pragma asm
      mov   A, x;
      movc  A, @A+PC;
    #pragma endasm
  }
}

When compiled, assembled, and linker in µVision2, generates the warning above. To translate this file, you must enable the following 2 checkboxes in Project - Options for file - Properties:

  • Generate Assembler SRC File
  • Assembler SRC File

CAUSE

When you compile all your C modules with the SRC directive and the assembler, the linker does not detect the required C run-time libraries (because the files were assembled). In this case, you must add the libraries to your project manually.

RESOLUTION

For a project in the SMALL memory model that uses no floating point arithmetic, C51S.LIB is required.

For a project in the LARGE memory model that uses floating-point, C51FPL.LIB and C51L.LIB are required.

If a project uses floating arithmetic, it is important that C51FPx.LIB is included before the standard library file C51x.LIB. Otherwise printf and scanf will not work with floating-point numbers.

When you are using µVision, you may simply add the require library file(s) to the project in the same way as you are adding source files.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Thursday, December 22, 2005


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  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.