cancel
Showing results for 
Search instead for 
Did you mean: 

.lib file in IAR Embedded workbench

harinath
Associate III
Posted on July 05, 2012 at 04:57

I need to program some algorithms to STM32F103. I want to create a .lib file similar to the attached files, then i want to link in IAR embedded workbench project & call the algorithms.

The attached files are from a firmware project from ST:  

http://www.st.com/internet/evalboard/product/250367.jsp

I could not find how to create a .lib file in IAR embedded workbench.

Is that attached library created in some other software like Visual studio ?

I know how to link this .lib in application firmware project, but don't know which software i must use to create .lib file. 

Thank you

#iar-ewarm #.lib-file-creation
8 REPLIES 8
Posted on July 05, 2012 at 05:27

In Keil it's ''Project Options -> Output -> Create Library'' vs ''Create Executable''

I would imagine IAR/EWARM would be similar, but don't have it installed here.

http://netstorage.iar.com/SuppDB/Public/UPDINFO/006220/infocenter/tutor_libraries.html

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
harinath
Associate III
Posted on July 05, 2012 at 05:42

Thanks for quick reply. I read & experimented it before posting here. It gives file extension .a 

I would like to create .lib file. I also searched enough, could not find over web. 

I started thinking that .lib in attached files is created from Software like Visual studio ! & linked in IAR ewarm application project.

Does it work if we create .lib library in another C compiler ( Visual studio ) & import in IAR ewarm application project ?

Posted on July 05, 2012 at 06:12

I'm really not sure how hung up you should get over whether the extension is .a or .lib, they are both a collection of objects and it doesn't really denote if you're dealing with OMF, ELF, COFF or IEEE694 formats. In the same manner that .o or .obj doesn't convey any information. ELF files can represent executables, objects and shared objects (ie DLL) forms.

Compiling with Visual Studio, using x86, is going to break things. While different tool chains may share a common object/library formats it is often unwise to mix and match unless you're willing and able to do a lot of post link analysis.

My best recommendation would be to simply rename the file and see if that works, as that has a reasonably high probability of success. Most of the file type information can be inferred from the file's internal header structures.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
emalund
Associate III
Posted on July 05, 2012 at 17:02

Have done it in IAR, forgot how (now a Keil user) IAR tech support will help you, send them an e-mail

Erik
harinath
Associate III
Posted on July 06, 2012 at 07:33

Hi

I gave a mail to IAR Tech support, they asked me licence of the software to answer my question. Unfortunately I do not have licence for it. If it is a hobby project, extension is not at all problem for me. I need to do some documentation also ( .lib and its .h file would be nice in this case ) how to use this library. 

Thank you

raptorhal2
Lead
Posted on July 06, 2012 at 21:51

You have apparently done the first step, which is to create a project to compile your source files into a xxxx.a library using the Project Option, General Options, Output tab selection of a library output file.

Noe you need to create another project to use the library file along with your application code. In that project, select Project Options, Linker, Library tab Additional Libraries window and enter the path to your xxxx.a library. If you wish to compile a source code library instead, and/or add a library header file, the paths to these file should be added to the Project Options, C/C++ Compiler, Preprocessor tab Include Directories window.

Your project will be more portable if you copy the library object or source and header files to a subdirectory in the project directory. The path name can be something like $PROJ_DIR$\Harinath\xxxx.a.

I haven't tried this yet, so if I have it wrong, feel free to speak up.

Cheers, Hal

abelloni
Associate II
Posted on December 15, 2013 at 16:43

I need to program some algorithms to STM32F I want to create a .lib file similar to the attached files, then i want to link in IAR embedded workbench project & call the algorithms.

The attached files are from a firmware project from ST:

http://www.st.com/internet/evalboard/product/250jsp

I could not find how to create a

.lib file in IAR embedded workbench.

Is that attached library created in some other software like Visual studio ?

I know how to link this

.lib in

application firmware project, but don't know which software i must use to create

.lib file.

Thank you

________________

Attachments :

AHRS_Library.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0sQ&d=%2Fa%2F0X0000000biJ%2FUNdgZ_YBse0Vs623Kik.VXYSN3fdaQ6oUabMp.uELoo&asPdf=false
chen
Associate II
Posted on December 16, 2013 at 11:33

Hi

Even as a hobby user - you should still have a valid license of IAR Workbench.

There is a free version of workbench which is limited to 32K program space.

You download it and just apply for the license from IAR.

However, since you have a working copy of IAR -

in the project setting where you changed the output from executable to library file,

you can also change the name of the output file.

You simply change the output filename from .a to .lib