我使用 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
关于c - 对 sqrt(geany) 的 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28831136/