How to use pow () & sqrt () on UNIX?

How to use pow () and sqrt () function in Ubuntu? I have included the math.h header file, but it still gives me an error.

+5
source share
2 answers

Link to libm.so, adding -lm to compiler command line options.

+7
source

Try adding a -lmlinker to your team. Most mathematical functions live in libm, which must be explicitly related.

+9
source

All Articles