IAR Embedded workbench create library

Teo picture Teo · Jun 24, 2013 · Viewed 8.6k times · Source

I want to create a simple library (C/ANSI) in IAR Embedded Workbench and then use the library in another project. I found some documentation on their website. Although I do not understand it entirely, I managed to make myself a .r90 file and from what I understand that would be the library. Please note that I am a complete beginner in this area. In conclusion I would like a step-by-step description on how to create a library and then how to import it in another project. Thanks.

PS: I am using IAR Embedded Workbench for AVR and this version does not have the Library tab under Linker.

Answer

andy mango picture andy mango · Jun 24, 2013

Briefly.

  1. Bring up the Options for the library project.
  2. Under the "General Options" selection, choose the "Output" tab.
  3. Within the "Output" tab you will find an "Output file" selection that can be either Executable or Library.
  4. For the library project, choose library.
  5. Within the project that is to link against the library, open the Options for that project.
  6. Select the "Linker" options and choose the "Library" tab.
  7. Under the Library tab you will find an entry box labeled, "Additional libraries (one per line). Type the path to the library that you created into the entry box.

This will work for the ARM flavor. Other targets or versions of the Embedded workbench may vary.