ARM Technical Support Knowledge Articles

USING LIBRARY FUNCTIONS

Applies to: C51 C Compiler

Answer

QUESTION

How do I use the library functions (putchar, _getkey, calloc, free, init_mempool, malloc and realloc) in my project?

ANSWER

The relevent source files for the library functions are located in the lib folder inside the C51 installation.

First, the relevent source file must be included in the project. This is done by editing the project and adding the source file.

Second, the function prototype must be added to your source code with the extern keyword. This must be performed for each source file for which you wish to use the function. For example:

extern char _getkey();

The function may then be called.

MORE INFORMATION

Article last edited on: 2005-07-15 10:37:06

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