Tuesday, February 7, 2012

How to setup avr studio 5 and 6 to use static library

I search entire internet for a explanation of error "undefined reference to" functions inside static library, but no explicit solution found.

For users that he cannot resolve this issue I will post two photos, how to set up the project to import functions from static libraries.



In this case the .h files is inside the "Directories" (photo2) and the .a files inside the "Debug" folder of each static library project(how is shown on bottom of first photo).

When you compile a static library the compiler generates a file named "libProjectName.a" on "Debug" folder, on top of first photo is shown how can be included the .a libraries, to include .a libraries is necessary to write the .a file name without "lib" and without ".a"inside a quote ("").
With this setup you can include and use static library.

3 comments:

Anonymous said...

helped me. thanks.

DondiM said...

Thanks a lot.
Saved mi brain from destroying against the wall in front of me!

Michele.

Anonymous said...


I searched a lot for this ,
But none of site explains clearly about the exact steps required for including
'Custom AVR studio Static Libraries' into
'Custom AVR Studio GCC Project'.

This post really helped me !!!

A Big Thank you for the Author !!!!

From,
CSJ