开发者

How do I use pow() & sqrt() on UNix?

How do I use pow() and sqrt() function in Ubuntu? I have inc开发者_运维百科luded 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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜