IAR Linking problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-19 11:08 AM
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....''- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 4:32 AM
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]- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 4:53 AM
Does the ''offending'' source file include a device-specific header like stm32fxxx.h ?
(''#include ''stm32f4xx.h'' in the case of STM32F4). Do you have the define ''USE_STDPERIPH_DRIVER'' added to your project settings ? Take closer look at a working example project, and try to understand how this StdPeriph_Lib headers are working.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 6:40 AM
everything is okay , even i got two projects from ST site and they work great , but when i copy one source code to the other project this error comes up , all the libraries are in the right path just it says ''no definition...'' so it seems like the compiler read the fonction but it didnt find its source code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 7:28 AM
everything is okay , even i got two projects from ST site and they work great , but when i copy one source code to the other project this error comes up , all the libraries are in the right path just it says ''no definition...'' so it seems like the compiler read the fonction but it didnt find its source code
Did you check what I recommended - probably not ? Do you have the define ''USE_STDPERIPH_DRIVER'' added to your project settings ? Find the stm32f4xx.h file, open it in the editor, and search for the string '' USE_STDPERIPH_DRIVER''. If you look more closely, you will notice that stm32f4xx.h includes the stm32f4xx_conf.h file ONLY if this macro is defined. In my version at lines 7812 ff:
#ifdef USE_STDPERIPH_DRIVER
#include ''stm32f4xx_conf.h''
#endif /* USE_STDPERIPH_DRIVER */
The file
stm32f4xx_conf.h in turn includes the StdPeriph_Lib headers, where all those missing structs etc. are defined. Hence you need to define this macro globally (for the whole project). The best place are the project/build settings.
Of course you need to have such a file
stm32f4xx_conf.h in your project. If necessary, copy one over from another project, and adapt it.
Again:
Take closer look at a working example project, and try to understand how this StdPeriph_Lib headers are working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 7:30 AM
And BTW, you need to add the required/used StdPeriph_Lib source files to your project, too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 7:31 AM
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 7:58 AM
trust me it works and i tried it on my board , but when i copy an another working project on the same workspace i got this errors
ps: every library is inculded and nothing is missing- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 7:59 AM
the two projects have the prerocessus and includes paths
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-06-20 8:25 AM
everything is okay , even i got two projects from ST site and they work great , but when i copy one source code to the other project this error comes up , all the libraries are in the right path just it says ''no definition...'' so it seems like the compiler read the fonction but it didnt find its source code
Copying the files is not enough, you have to clone the project and retain the meta-data (include paths, defines, optimization, settings, etc) associated with the project.Up vote any posts that you find helpful, it shows what's working..
