ARM Technical Support Knowledge Articles

UNRESOLVED SYMBOL ?C_STARTUP

Applies to: BL51 Code-banking Linker/Locator

Answer


Information in this article applies to:


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 uVision2, generates the warning above. To translate this file, you must enable the following 2 checkboxes in Project - Options for file - Properties:

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 uVision, you may simply add the require library file(s) to the project in the same way as you are adding source files.

SEE ALSO

Article last edited on: 2005-12-22 15:48:27

Rate this article

[Bad]
|
|
[Good]
Disagree? Move your mouse over the bar and click

Did you find this article helpful? Yes No

How can we improve this article?

Link to this article
Copyright © 2011 ARM Limited. All rights reserved. External (Open), Non-Confidential