|ARM Technical Support Knowledge Articles|
Applies to: C51 C Compiler
Information in this article applies to:
Why do I get an Unresolved External Symbol error when I declare a C function prototype as taking a void parameter and not when I declare it using an unsigned char parameter? My function is defined in assembly code.
This causes an Unresolved External Symbol error:
unsigned char FOO(void);
unsigned char FOO(unsigned char);
In my assembly code:
A SEGMENT CODE PUBLIC _FOO RSEG A _FOO: ret END
In your assembly code you have started the function name with an underscore. This indicates that the parameters to the function are passed in registers. When you declare the protoype with no parameters it does not match the definition, hence the Unresolved External Symbol error.
If you do not wish to pass a parameter to the function then change the name in your assembly code to 'FOO', removing the underscore. The definition will then match up with the prototype.
Article last edited on: 2001-08-16 00:00:00
Did you find this article helpful? Yes No
How can we improve this article?