对 sqrt(geany) 的未定义引用

undefined reference to sqrt(geany)

我使用 Geany 进行 C 编程。当我尝试构建文件时,它给了我

error:undefined reference to sqrt.

编译:gcc -Wall -c "%f"

构建:gcc -Wall -o "%e" "%f"

执行:./%e

我试图将 -lm 添加到构建命令,但它给了我

gcc error:no such file or directory.Compilation Failed.

带参数的编译器和链接器选项必须分开,你不能像你那样编译它们。

将它们分开,例如

gcc -Wall -o "%e" "%f" -lm