-3
#include <stdio.h>
#include <math.h>
int main()
{
printf("%.81f\n", 1+2*sqrt(3)/(5-0.1));
return 0;
}
출력 : /tmp/a4-4oU730.o 오류 : 링커 명령clang을 math.h로 컴파일하는 방법?
#include <stdio.h>
#include <math.h>
int main()
{
printf("%.81f\n", 1+2*sqrt(3)/(5-0.1));
return 0;
}
출력 : /tmp/a4-4oU730.o 오류 : 링커 명령clang을 math.h로 컴파일하는 방법?
시도가 -lm
추가 (호출을보고 사용 -v) 종료 코드 1 실패 연타 기능 main': a4.c:(.text+0x4f): undefined reference to
SQRT '에서 빌드 명령에 수학을위한 libm. 즉, 귀하의 코드는 Mac OS에서 clang 4.1을 사용하여 잘 작동합니다.
Google에 오류 메시지가 표시되면 수천 개의 솔루션이 나옵니다. –