I am unable to compile the following simple C code and I don't know why.
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <math.h>
int main(){
double result;
result = cos(0.5);
printf("asin(0.5) is %f\n", result);
return 0;
}
The error message I receive after I try to compile is -
In function
'main':
test.c:(.text+0xlc): undefined reference to 'cos'
collect2: ld
returned 1 exit status
ld, the linker. Invariably the reason is a missing import library.