F
Fan Zhang
Hi again,
I am new to compiling C programs in Linux/Unix. I wanted to compile a
program by using gcc, but it turned out that gcc does not know where to
locate the library being called.
The program is as follows,
#include <math.h>
int main()
{
double ss;
double ff;
ss=1.0;
ff=sin(ss);
printf("%6.4f\n",ff);
return 0;
}
The error message is,
/tmp/ccIV3yAb.o: In function `main':
/tmp/ccIV3yAb.o(.text+0x1e): undefined reference to `sin'
The command I used to compile is
gcc test.c
Could anyone please let me know where I did wrong? Thanks!
Fan
I am new to compiling C programs in Linux/Unix. I wanted to compile a
program by using gcc, but it turned out that gcc does not know where to
locate the library being called.
The program is as follows,
#include <math.h>
int main()
{
double ss;
double ff;
ss=1.0;
ff=sin(ss);
printf("%6.4f\n",ff);
return 0;
}
The error message is,
/tmp/ccIV3yAb.o: In function `main':
/tmp/ccIV3yAb.o(.text+0x1e): undefined reference to `sin'
The command I used to compile is
gcc test.c
Could anyone please let me know where I did wrong? Thanks!
Fan