Nguyễn Hào
New member
How do I compile math h in Ubuntu?
Answer
Compiling C program with math.h library in Linux.
Answer
Compiling C program with math.h library in Linux.
- The solution is: Use -lm after the compile command.
- The compile command is: gcc number.c -o number.
- program will throw an error, and the error is: sh-4.3$ gcc number.c -o number number.c: undefined reference to ‘sqrt’ number.c: undefined reference to ‘pow’
- The command is: gcc number.c -o number -lm.