Undefined reference to ' tan '
But already contains the head file <math.h>, but still an error, said to be unable to find Tan
The cause of this problem is not very clear, but the online solution is to compile the time with the parameter-lm
There say L means Lib, M represents Math.h,
******************************************************************************************************
Here are some instructions
using the library functions declared in MATH.H is a bit special, the GCC command line must have the-LM option, because the math functions are located in the Libm.so library file (these libraries are usually located in the/lib directory),- The LM option tells the compiler that the mathematical functions used in our program are to be found in this library file. Most of the library functions used in this book (for example, printf) are located in the Libc.so library file, and the library functions in libc.so do not need to be added-LC option at compile time, which of course is not wrong because this option is the default option for GCC.