How do I use pow() and sqrt() function in Ubuntu? I have included the math.h header file but it still gives me an error.
Try adding -lm
to your linker command. Most of the math functions live in libm
which needs to be explicitly linked in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With