ARM Technical Support Knowledge Articles

GET ERROR A45: USING IN-LINE ASSEMBLER

Applies to: C51 C Compiler

Answer


Information in this article applies to:


QUESTION

I'm trying to reference a global variable using in-line assembler, but when the project builds I get the following error:

<module_name>.SRC (line) Error A45: UNDEFINED SYMBOL (PASS-2)

The global variable is defined as extern in my header file. What's wrong?

ANSWER

Your C code does not reference that global variable, so the compiler does not add it to the .SRC file when it is built. In these rare cases, you will have to add the external declaration as in-line assembly code for that module as follows:

#pragma asm
  EXTRN DATA (variable_name)
#pragma endasm

MORE INFORMATION

SEE ALSO

Article last edited on: 2007-02-20 17:39:11

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