i'm compiling the program below in keil uvision 5 and the eror".\Objects\program.axf: Error: L6218E: Undefined symbol main (referred from __rtentry2.o). Not enough information to list image symbols." appears as result.
#include "lpc17xx.h" #define d 1000void delay_ms(uint32_t time);int main(void){ LPC_GPIO1->FIODIR=0xf<<24; LPC_GPIO1->FIOCLR=0xf<<24; while(1){ LPC_GPIO1->FIOSET=1<<24; delay_ms(d); LPC_GPIO1->FIOSET=1<<25; delay_ms(d); LPC_GPIO1->FIOSET=1<<26; delay_ms(d); LPC_GPIO1->FIOSET=(1<<25)|(1<<26)|(1<<24); delay_ms(d); } } void delay_ms(uint32_t time) { uint32_t i; while(time--) { for(i=0;i<16666;i++);} }
any helpful answer will be appreciated
Are you compiling as 'C' or C++ ?
A good first step is always to just put the message into your favourite internet search engine; eg,
https://community.arm.com/developer/tools-software/tools/f/keil-forum/29001/activ22-axf-error-l6218e-undefined-symbol-main-referred-from-rtentry2-o
How to properly post source code: