This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Error: L6218E: Undefined symbol main (referred from rtentry2.o).

Hello!!!!!!!!!
I have posted my program and the building message and errors below.Please solve the following errors and warning.

#include <lpc21xx.h>

#define RS 1<<4                 // for write operation R/W pin of lcd is zero , so it is always grounded and not necessary to define //
#define EN 1<<5

 void delay(void)
{
  unsigned int d;
  for(d=0; d<1000000; d++)
  {

  }
}
 void outdata(unsigned char x)             // send the data (cmd or data) to port //
{
  int i;
  for (i=0 ; i<8 ; i++)
  {
     if(x & (0x01<<i))
         {
           IOSET0 |= 1<<(i+16);                  // DB0 - DB7 must be connected to P0.16 - P0.23 //
         }
         else
         {
           IOCLR0 |= 1<<(i+16);
         }
  }
}
 void enablepulse(void)
 {
   IOSET0 |= EN;
   delay();
   IOCLR0 |= EN;
 }

  void lcdcmd(unsigned char cmd)
{
 outdata(cmd);
 IOCLR0 |= RS;             // select cmd register //
 enablepulse();
}
  void lcddata(unsigned char data)
 {
   outdata(data);
   IOSET0 |= RS;                     // select data register //
   enablepulse();
  }
 void lcdstring(unsigned char string[])
 {
         int y;
         for(y=0; string[y]!='\0'; y++)
        {
                lcddata(string[y]);
        }
 }
 void lcdinit(void)
 {
         IODIR0 |= 0xFFFFFFFF;
         lcdcmd(0x38);                                  // Function set: 2 Line, 8-bit, 5x7 dots //
         delay();
         lcdcmd(0x0F);                                 //Display on, Curson blinking command//
         delay();
         lcdcmd(0x0E);                                // Display on cursor on //
         delay();
         lcdcmd(0x01);                               // Clear LCD //
         delay();
         lcdcmd(0x80);                               // Choose 1st line //
         delay();
         lcdcmd(0x06);                              // Entry mode, auto increment with no shift //
         delay();
 }
 void lcdclear(void)
 {
         lcdcmd(0x01);
 }
 void lcd1stline(void)
 {
         lcdcmd(0x80);
 }
 void lcd2ndline(void)
 {
   lcdcmd(0xC0);
 }
 void gotorowcoloum(unsigned char row, unsigned char coloum)
 {
         if(row == 1)
         {
                 lcdcmd(0x80+coloum-1);
         }
        else if(row == 2)
         {
                 lcdcmd(0xC0+coloum-1);
         }
 }

Build output:
Build target 'Target 1'
compiling lcd.c...
lcd.c(94): warning: #1-D: last line of file ends without a newline
linking...
lcd.axf: Error: L6218E: Undefined symbol main (referred from rtentry2.o).
Target not created