gcc 引用math.h頭文件,編譯出現undefined reference to `pow‘等錯誤時,須要加參數-lm....

在本身編寫的函數中調用數學函數時,以下例子:html #include<stdio.h> #include<math.h> void p(void) { printf("%g\n", pow(2, 3)); } int main() { p(); return 0; } 出現編譯問題:函數 undefined reference to `pow' 解決方法
相關文章
相關標籤/搜索