ysy$ cc p1-12.c -o p1-12
/tmp/ccCv6wOm.o: In function 'main':
/tmp/ccCv6wOm.o(.text+0x28): undefined reference to 'exp'
collect2: ld returned 1 exit status
왜 이런 에러가 나죠??
ysy$ cat p1-12.c
#include <stdio.h>
#include <math.h>
int main(void)
{
float x,y;
scanf("%f",&x);
y = exp(x);
printf("%f\n",y);
return 0;
}
ysy$ g++ p1-12.c -o p1-12
에러가 없습니다.