Mail Archives: djgpp/2005/02/02/09:52:51
Hi,
I compiled a test prog, referencing long double floating point functions (like cosl, sinl, etc.) with DJGPP 2.03, but these function names aren't found by the linker, even if I put the define <math.h> or <libm/math.h> statement inside the source code, and use the -lm switch.
This is the test program.
#include <libm/math.h>
#include <stdio.h>
#include <stdlib.h>
int main (void)
{
long double r1 = 0.0L, r2 = 0.0L, r3 = 0.0L, r4 = 0.0L, x = 0.0L;
x = 1.320089L;
r1 = sinl(x);
r2 = cosl(x);
r3 = expl(x);
r4 = logl(x);
printf("\n\n");
printf("Variable x: %24.16Lf, r1: %24.16Lf, r2: %24.16Lf, r3: %24.16Lf, r4:
%24.16Lf\n\n",x,r1,r2,r3,r4);
return 0;
}
The error message returned during the compilation/linking is:
c:/djgpp/tmp/ccCsWzqh.o(.text+0x10c):test_long_double.c: undefined reference
to `_sinl'
c:/djgpp/tmp/ccCsWzqh.o(.text+0x135):test_long_double.c: undefined reference
to `_cosl'
c:/djgpp/tmp/ccCsWzqh.o(.text+0x15e):test_long_double.c: undefined reference
to `_expl'
c:/djgpp/tmp/ccCsWzqh.o(.text+0x175):test_long_double.c: undefined reference
to `_logl'
collect2: ld returned 1 exit status
even if I put the include of math.h (with or without libm/) in the source code.
Is something missing in the DJGPP math library? What can I do to use long double math functions?
Is there any math library, compatible with DJGPP 2.03, supporting such long double floating point functions?
Thanks in advance.
Luigi
(Italy)
________________________________________________________________________
Cerchi un laboratorio fotografico aperto 24 ore su 24?
Stampa le tue foto digitali su Kataweb e le ricevi a domicilio in 48 ore.
http://www.kataweb.it/foto
- Raw text -