I searched forum but found nothing about this problem.

When I compiled these two source files, I got 700 bytes code.

/* File: main.c */ /* Procesor: Atmega8 */ /* Crystal: 10 MHz */ /* Compiler: Avrstudio ver. 4.13 build 528 + Winavr-20070525 */ unsigned int D1,D2; float pressure, temperature; float calc_float(unsigned int arg1); int main(void) { for(;;) { pressure = calc_float(D1); temperature = calc_float(D2); } }//main ------------------------------------------------------- /* File: calc_float.c */ float calc_float(unsigned int arg1){ float fd1; fd1 = (float)arg1; return 100000.0 / fd1; }

Then I created library from file "calc_float.o":

avr-ar rcs libmyfloat.a calc_float.o

But then when I compiled with library libmyfloat.a,

the code was 1500 bytes. It increased twice!!

I have experimented with another moduls in my library and

I found that only functions with float math enlarged the code.

In Project-Options-Libraries I added libc.a and libm.a.

What am I doing wrong?