Mischief City
Mischief City

Reputation: 1

Header File Difficulties

I'm learning to program 8051 microcontrollers, but have run into some difficulties regarding the 'header files'.

Basically, I took the header file from Keil for my specific microcontroller(AT89S52), and plugged it into a header file in my IDE with a '.h' ending. This was not the issue though.

The problem occurs when I attempt to compile and link my work, where the built-in debugger claims that the terms "sfr" and "sbit" are unknown. In specific, the debugger says

"error: unknown type name 'sbit'"

"error: unknown type name 'sfr'".

I do understand where this is coming from, as these are not defined in the given header file text which I pulled from Keil, but regardless, where is my mistake and what is the solution?

I have looked and can't really find an answer online. If you have any questions, I'll attempt to answer them as soon as possible. The link to the header file is below. I'm working in an IDE called 'Code Blocks'.

http://www.keil.com/dd/docs/c51/atmel/regx52.h

Upvotes: 0

Views: 1195

Answers (1)

Rob Johnson
Rob Johnson

Reputation: 46

the header file you linked is not for the microcontroller you specified in your text. you can not repurpose header files from one product to another. you must find the correct header files for your specific microcontroller.

Upvotes: 1

Related Questions