>
> If I compile a source file as:
>
> gcc -O3 -c fin.o -o fin.c
>
> everything works fine. If however, I compile as:
>
> gcc -g -c fin.c -o fin.o
>
> undefined reference to 'log'
>
Easy, I think. I noticed this also in HPUX.
Usually, things like sin() and log() are FUNCTIONS, stored in libm.so.
But some optimizers convert them in inlined code, direct FPU
op-codes or something similar.
Debug mode forces using library-mode, and O3 mode optimizes some calls.
This works only for some calls, say if you use sin(), you don't need libm
in optimized mode, but you will need libm for j0 (bessel and so on)
both in debug and optimized code.
Expect this helps....
--
Juan Antonio Magallon Lacarta mailto:[EMAIL PROTECTED]
Grupo de Informatica Grafica Avanzada http://giga.cps.unizar.es
Tlf: 34-976-762354,1916 - Fax: 34-976-761914