On Fri, 21 Jul 2000, Sergey Panasyuk wrote:
Dear Sergey,
You are right, it is not linked properly. You have to designate the math
library for gcc.
What i mean is:
gcc myprogram.c -lm
after this in a.out you will have the binary code.
Best wishes,
Gabor
> Hi, I am trying to compile some c code and have problems
with gcc. > This is my code saved as sample.c
> #include<stdio.h>
> #include<math.h>
>
> int main(void)
> {
> printf("%f", sin(3.14));
> }
>
> then at terminal I tipe gcc sample.c and got error that sin is undefined.
> Samething happened for cos, sqrt.
> I did compile the same code using VC++ 6.
> I think the code compiled with no errors but is not linked.
>
>
>