找到解决方式:
https://stackoverflow.com/questions/8671366/undefined-reference-to-pow-and-floor
You need to compile with the link flag -lm
, like this:
gcc fib.c -lm -o fibo
This will tell gcc to link your code against the math lib. Just be sure to put the flag after the objects you want to link.