How to flash error if a macro is not defined in program
The problem is likely to be that the preprocessor operates sequentially so you should perform the define before the include. Try the following:

#include &lt;avr/io.h&gt;
#define LCD_PORT PORTA
#include &lt;lcd.h&gt;