AnsweredAssumed Answered

Error in PSP undefined reference to main

Question asked by OLIVIA CHRISTY VARGHESE on Apr 25, 2017
Latest reply on Apr 25, 2017 by Daniel Chen

hello guys,


I am working with MQX 4.2 . in IAR and i created a project with 3 tasks and was working fine. Then i changed the bsp for my LCD code  and then i found my code with 3 task is showing some linker error in IAR.


Error[Li005]: no definition for "main" [referenced from cmain.o(rt7M_tl.a)]


The code doesn't have a function as main. 

These are the tasks.

{DAC_TASK, DAC_Task, 1500, 8, "Dac_Task", MQX_AUTO_START_TASK, 0, 0 },
{ADC_TASK, ADC_Task, 2500, 9, "ADC_Task", 0, 0, 0 },
{ KEYPAD_TASK, Keypad_Task, 5000, 8, "Keypad_Task", 0, 0, 0 },


then i tried with the same bsp and psp in kds and found that it is giving same kind of error in PSP of that code


C:\Freescale\Freescale_MQX_4_2\mqx\build\kds\psp_frdmk64f\debug/..\..\..\..\source\psp\cortex_m\compiler\gcc_arm/comp.c:201: undefined reference to `main'


error is shown at this function

void toolchain_startup(void)
// initialize necessary hardware (clocks, ddr, ...)
// initialize data - copy and zero sections
// static variables can be used on return
// register destructor calls of static objects
// run constructor calls of static objects
// run main, if return go to exit
exit(main());                              // here is the error undefined reference to main.


does anybody have any idea about what is this error and how to solve it

please help


thanks and regards,