报错内容   

/tmp/cc7eQyD4.o: In function `main':
test.c:(.text+0x51): undefined reference to `sqrt'
collect2: ld returned 1 exit status

 

在编译后面加上-lm

gcc -o test test.c -lm

相关文章: