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

Sepehr Aghili picture Sepehr Aghili · Aug 11, 2015 · Viewed 16.5k times · Source

anyone can help me?? my board is LPC1768 and the sensor is BMP180

Rebuild target 'Target 1'
compiling BMP180.c...
compiling I2C.c...
assembling startup_LPC17xx.s...
compiling system_LPC17xx.c...
compiling GPIO_LPC17xx.c...
compiling PIN_LPC17xx.c...
linking...
.\Objects\asdsa.axf: Error: L6218E: Undefined symbol main (referred from __rtentry2.o).
Not enough information to list image symbols.
Finished: 1 information, 0 warning and 1 error messages.
".\Objects\asdsa.axf" - 1 Error(s), 0 Warning(s).
Target not created.

Answer

Purgoufr picture Purgoufr · Apr 14, 2016

I solved this problem with the following steps;

  1. Delete your old project and create new project
  2. Choose true library from Manage Run Time Environment like so: Manage Run Time Environment
  3. Configure "Options for Target" segment. Define symbol USE_STDPERIPH_DRIVER and define project path like so: Options for Taget
  4. Test your configuration. Please write the following code:

     #include "stm32f10x.h"                  // Device header
    
     int main() {
     }