cancel
Showing results for 
Search instead for 
Did you mean: 

IAR Linking problem

achourwissem
Associate II
Posted on June 19, 2013 at 20:08

hello

i have a folder contains many projects and all of them goes to same library file , each projects work great , but when i copy the main code of one project to other i got the linking problem like that ''Error[Li005]: no definition for....''

18 REPLIES 18
frankmeyer9
Associate II
Posted on June 20, 2013 at 17:49

Yes, to have correct path settings for includes and libs is a necessary presupposition.

And doing this copying/porting of project often, one begins to appreciate the advantage of keeping those paths relative, or based on environment variables ...

me780411
Associate
Posted on June 20, 2013 at 19:49

It seems that you didn't configure the IAR compiler to link the headers correctly here is a video that shows how to do this step by step, try to include all the folders that hold all the headers that you need

http://www.youtube.com/watch?v=bRRUkF0jMyc

achourwissem
Associate II
Posted on June 20, 2013 at 20:37

i made a clone of one exemple project and still have problems it dont recognize the same functions

i think there is a problem in linker option , anyone have an idea ?
frankmeyer9
Associate II
Posted on June 21, 2013 at 08:22

Error[Li005]: no definition for ''RCC_APB2PeriphClockCmd'' [referenced from C:\Users\Wissem\Desktop\my work\Debug\Obj\main.o]

 

Error[Li005]: no definition for ''GPIO_Init'' [referenced from C:\Users\Wissem\Desktop\my work\Debug\Obj\main.o]

 

Error[Li005]: no definition for ''SYSCFG_EXTILineConfig'' [referenced from C:\Users\Wissem\Desktop\my work\Debug\Obj\main.o]

 

Error[Li005]: no definition for ''EXTI_Init'' [referenced from C:\Users\Wissem\Desktop\my work\Debug\Obj\main.o]

 

Error[Li005]: no definition for ''NVIC_Init'' [referenced from C:\Users\Wissem\Desktop\my work\Debug\Obj\main.o]

 

Did you investigate where those functions/definition live ?

As said in an earlier posting, you need to have those StdPeriph_Lib source files in the project, say:

stm32f4xx_rcc.c

 

stm32f4xx_gpio.c

 

stm32f4xx_syscgf.c

 

misc.c

 

from the .../Libraries/STMxxx_StdPeriph_Driver/src folder in this case.

Otherwise, as my crystal ball is out of business momentarily, sceenshots and build logs might prove helpful.

achourwissem
Associate II
Posted on June 21, 2013 at 11:12

thank you all , that was helpful :)

i just added to my inclide path  ......./src and i followed every function didnt recognize it and included its .c file

and it works now
achourwissem
Associate II
Posted on June 21, 2013 at 11:13

thank you all , that was helpful :)

i just added to my inclide path  ......./src and i followed every function didnt recognize it and included its .c file

and it works now
achourwissem
Associate II
Posted on June 21, 2013 at 12:26

Sorry another thing

i got this error when i included one file stm32f4xx_it.c because i needed ClickReg deifinition:

Error[Pe147]: declaration is incompatible with ''uint8_t Buffer[4]'' (declared at line 43 of ''C:\Users\Wissem\Desktop\my work\stm32f4xx_it.c'')

crt2
Associate II
Posted on June 24, 2013 at 11:33

Do you have another variable declared Buffer?

frankmeyer9
Associate II
Posted on June 24, 2013 at 13:42

If you want this variable to be globally visible, you need to define it with identical type on all occurences. More exactly, define it in one file with an initializer, and declare it in all other files without initializer, but with the extern keyword.

If you did not want to make this variable global, you have two clashing definitions.

Either rename one instance, or make both static.

Additionally, it would be helpful to post both definitions/declarations, with the filename they occur in.