I am having problems in math.h header file and when I use square root function as in sqrt(d). But my compiler is not supporting this. Please advise me about this problem.
My Ubuntu version is 2012.
closed as off-topic by Sergiy Kolodyazhnyy, TheWanderer, muru, Seth♦ Mar 12 '16 at 23:31This question appears to be off-topic. The users who voted to close gave this specific reason:
|
|||||||||||||||||||||
|
|||||||||||||||||||||
|
Append With all recent versions of GCC on GNU/Linux systems like Ubuntu, when you use the math library, you have to explicitly link to it. It is not automatically linked to along with the rest of the standard C library. If you are compiling on the command-line with the For example: |
||||
|
|
|
If you are going to compile a C program with math.h library in LINUX using GCC or G++ you will have to use –lm option after the compile command.
Here, gcc is compiler command (compiler name) for more details here is the link containing complete article on it. |
|||||
|