Keil Logo

BL51: Warning L1 (Unresolved External) Using Inline Assembly


Information in this article applies to:

  • C51 Version 5.50a and later

QUESTION

I have a program that consists on several assembler files and a single C file that I compile with the #pragma SRC directive.

I'm receiving the following linker error messages:

WARNING L1:  UNRESOLVED EXTERNAL SYMBOL
SYMBOL:  ?C?STRCPY
MODULE:  ASDF.OBJ (ASDF)

WARNING L2:  REFERENCE MADE TO UNRESOLVED EXTERNAL
SYMBOL:  ?C?STRCPY
MODULE:  ASDF.OBJ (ASDF)
ADDRESS: 0223H

What am I doing wrong?

ANSWER

The linker is not finding the ?C?STRCPY segment. This has to do with the way you are creating the object files for your project.

When you compile a C file, the C compiler includes external references to the standard C library files in the OBJ file that is generated. When you use the #pragma SRC directive with a C file to generate an assembler SRC file, that information is no longer generated by the C compiler. So, you must generate it automatically (if there isn't another C file in your project that isn't compiled with the SRC directive.)

To successfully link your project, you must manually include the proper library file in your project.

  • C51S.LIB: Small model library without floating-point math.
  • C51C.LIB: Compact model library without floating-point math.
  • C51L.LIB: Large model library without floating-point math.
  • C51FPS.LIB: Small model library with floating-point math.
  • C51FPC.LIB: Compact model library with floating-point math.
  • C51FPL.LIB: Large model library with floating-point math.

MORE INFORMATION

SEE ALSO


Last Reviewed: Thursday, February 25, 2021


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.