Using math.h and libm math library
已回答
I've read that I need to include -lm option to the linker to compile the code with the math.h file. But I don't see where to put this in the IDE for C
请先登录再写评论。
Hello!
It depends on how you build your project.
For example, if you use CMake to build your project, you need to follow https://stackoverflow.com/a/34628342.
If you run a single file in CLion (https://www.jetbrains.com/help/clion/run-single-file.html), you need to specify
-lm
in the Compiler options field of your run/debug configuration of the type “C/C++ File”.