gcc -o test test.c编译报错

报错内容   

/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

原文地址:https://www.cnblogs.com/zengsf/p/7150893.html