the following type of macro defining causing error , what should i do? plz help.
#define LCD_DATA P2
error: 'LCD_DATA': undefined identifier
You forgot to post enough code that we could see your macro actually used in some context.
It looks like the compiler processed some code without having first seen the #define. Maybe a missed include file?
what header file i should use? i only used AT89X51.H
Well, where do you have your #define?
And have you spelled your #define correctly?
Because the error message indicates that the preprocessor have not seen and replaced LCD_DATA - but the preprocessor will not generate an error for any unknown symbols. The compiler will, if LCD_DATA is still visible after the preprocessing step.
So show us real code that gives the error.
You should probably start here: http://www.keil.com/support/man/docs/uv4/uv4_examples.htm
More examples here: http://www.keil.com/download/list/c51.htm
Books to help you here: http://www.keil.com/books/