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.