簡體   English   中英

gcc:錯誤:無法識別的命令行選項“ -1m”

[英]gcc: error: unrecognized command line option ‘-1m’

當我運行包含以下內容的C代碼時

#include <math.h>

然后在for循環中

distance[i] = (float) pow((float) pow(X1[i] - xpos[i],2)+(float) pow(X2[i] - ypos[i],2),0.5);

並嘗試與

gcc test.c -o test -1m

我得到了錯誤

gcc: error: unrecognized command line option ‘-1m’

我需要將某些內容下載到計算機上還是其他內容?

當我在for循環中有一個不同的數學表達式時(一個不需要math.h的表達式),我的代碼可以編譯並完美運行。

應當是-lm ,其中“ library”為小寫字母L。 您正在鏈接數學庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM