Ich will das folgende Programm übersetzen:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
float a,b,c;
int main()
{
a = b * c + log(b / sqrt(c)) / pow(b + c,3);
printf("%f\n", a);
return 0;
}
Doch ich erhalte als Fehler:
gcc "Übung5_A2.c" -o "Übung5_A2"
/tmp/ccgw82Dj.o(.text+0x39): In function `main':
: undefined reference to `sqrt'
/tmp/ccgw82Dj.o(.text+0x4b): In function `main':
: undefined reference to `log'
/tmp/ccgw82Dj.o(.text+0x75): In function `main':
: undefined reference to `pow'
collect2: ld returned 1 exit status
Wiso sind ihm Logarythmus, Wurzel und Exponent nicht bekannt, obwohl ich math.h importiere ?
Lesezeichen