开发者

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

开发者 https://www.devze.com 2023-01-13 12:04 出处:网络
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

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

精彩评论

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