초보적인 질문입니다.. 컴파일시 에러가 나서요..

hanid의 이미지

간단한 테스트 프로그램입니다..

////////////////////////////////////////////

#include <stdlib.h>
#include <stdio.h>
#include <math.h>

int main(void)
{
float x,y,z;

x=1.36;
y=sqrt(x);
z=pow(x);
}

///////////////////////////////////////////////

// 에러구문입니다....
gcc -o test test.c
/tmp/ccQaxbBs.o: In function `main':
/tmp/ccQaxbBs.o(.text+0x2b): undefined reference to `sin'
/tmp/ccQaxbBs.o(.text+0x43): undefined reference to `sqrt'
collect2: ld returned 1 exit status

제가 해본지가 얼마 안되어서 어디서 잘못되었는지 모르겟습니다.

답변부탁 드리겠습니다..

seoleda의 이미지

gcc -o test test.c -lm 으로 해보세요..