Hi , I have this error message (activ22.axf: Error: L6218E: Undefined symbol main (referred from rtentry2.o).)when I build target . this is the code
#include <LPC17xx.H> /* Definiciones para el LPC17xx */
#define N 10000
static int8_t contador; static int32_t leds=0x10;
void delay(int32_t milisegundos) { int32_t i,j; for(j=0;j<milisegundos;j++) { for(i=0;i<N;i++); // retardo de X milisegundos } }
int main (void) { LPC_GPIO1->FIODIR = 0x000000F0; /* P1[7..4] como salidas */ LPC_GPIO1->FIOCLR = 0x000000F0; /* apaga todos los LEDs */ while(1) { contador++; LPC_GPIO1->FIOPIN = leds; delay (100*contador); // retardo variable leds<<=1; if(leds==0x100) { leds=0x010; contador=0; } } }
please help me because I don't know how to do . thanks
I use C
And you have verified that the project includes the C file where your main() is?
Do you get a compmilation error if you add an intentional error in that file?
Might you have played with any compiler options, affecting external linkage?
Now the program compilates , the error were that I have not add the main.c file to the group SourceFiles . Thank you very much .
It always helps to do sit down and try to figure out what may be required for something to work, and what steps that can be performed to verify where something goes wrong.
Programming is very much about looking for clues.