>> Edit article
이름
제목
패스워드
: #include <stdio.h> : #include <math.h> : : void main() { : printf ("%1.8f", sqrt((double)2)); : } : : gcc test.c 를 실행하면 다음과 같은 메세지가 나옵니다. : : test.c: In function `main': : test.c:4: warning: return type of `main' is not `int' : /var/tmp/ccwfDoBO.o: In function `main': : /var/tmp/ccwfDoBO.o(.text+0x24): undefined reference to `sqrt' : collect2: ld returned 1 exit status : : 왜 이런 현상이 나오는거지요? : 분명 math.h에는 sqrt가 define되어 있는데 말입니다. : 좀 도와주세요. 그럼이만. gcc test.c -lm math 라이브러리를 컴팔할때 링크 시켜야 합니다.
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved