📜  未定义对“sqrt”的引用 - C 编程语言代码示例

📅  最后修改于: 2022-03-11 15:04:42.037000             🧑  作者: Mango

代码示例1
The math library must be linked in when building the executable.
How to do this varies by environment, but in Linux/Unix, just add
-lm to the command:

gcc test.c -o test -lm

The math library is named libm.so, and the -l command option
assumes a lib prefix and .a or .so suffix.

Credit: wallyk