📅  最后修改于: 2022-03-11 15:04:42.037000             🧑  作者: Mango
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