xenon
01-08-2004, 03:34 PM
I started using Knoppix (3.3) some days ago, mainly to write C-programs (but I'm liking it more&more, also for the rest of the package!).
I am, however, experiencing problems in compiling programs that use <math.h>. F.i.:
#include <stdio.h>
#include <math.h>
int main(){
printf("%f\n",sqrt(123.456));
return 0;
}
Won't compile, giving:
knoppix@ttyp0[test]$ gcc test.c
/tmp/cc8Hr3am.o(.text+0x1a): In function `main':
: undefined reference to `sqrt'
collect2: ld returned 1 exit status
Can someone explain what's going wrong? I have no problems including <ctype.h> or <string.h>.
I'm a complete Linux noob, so please help me...
I am, however, experiencing problems in compiling programs that use <math.h>. F.i.:
#include <stdio.h>
#include <math.h>
int main(){
printf("%f\n",sqrt(123.456));
return 0;
}
Won't compile, giving:
knoppix@ttyp0[test]$ gcc test.c
/tmp/cc8Hr3am.o(.text+0x1a): In function `main':
: undefined reference to `sqrt'
collect2: ld returned 1 exit status
Can someone explain what's going wrong? I have no problems including <ctype.h> or <string.h>.
I'm a complete Linux noob, so please help me...