Keil Logo

A51: FATAL ERROR (CAN'T OPEN FILE) WITH C HEADER FILES


Information in this article applies to:

  • C51 All Versions
  • C51 Version 7.50

QUESTION

When including C header files in assembly modules, the .H files cannot be found in some instances. For example, when including C header files as follows:

$include (reg52.h)

the assembler reports the following error message:

A51 FATAL ERROR -
  FILE:       REG51.H
  ERROR:      CAN'T OPEN FILE
A51 TERMINATED.

ANSWER

This problem may be caused by using the macro programming language (MPL) in your assembly modules.

To correctly include a C header file in an assembly program, you must use the C style include statement. For example:

#include "reg52.h"

When you use the C-style include statement, the header file is located and included.

The Keil A51 Assembler automatically includes the header file reg51.h. To stop the assembler from automaticlly including this file, go to:

Project -> 'Options for Target' -> the 'A51' tab -> and uncheck 'Define 8051 SFR Names'.

MORE INFORMATION

  • Refer to NOMOD51 in the Ax51 User's Guide.

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Friday, July 15, 2005


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.