安田と申します。
Vine Linux2.5(FTP)を使っています。
それで、gccについて、ちょっと不具合があるようなので、
どうか、ご教授ください。
問題というのは、以下のプログラムをコンパイルしたときに、
エラーが出ることです。
#include <stdio.h>
#include <math.h>
int main()
{
double x, s;
scanf("%f",&x);
s = sin(x);
printf("%f\n",s);
return 0;
}
エラーメッセージは、
/tmp/ccNb6t26.o: In function `main':
/tmp/ccNb6t26.o(.text+0x27): undefined reference to `sin'
collect2: ld returned 1 exit status
というものです。
どうやら、math.hをうまく読みこめていないようなのですが、
これはどうしてでしょうか?
それとも、自分のとんちんかんな勘違いなのでしょうか?
--
安田 健一 <kenn@xxxxxxxxxx>
http://isweb43.infoseek.co.jp/computer/yasuda32/