[討論] cos, round

看板b93902HW作者 (12/26~30雄友週)時間18年前 (2005/12/22 17:19), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串1/1
我在程式裡用math.h的cos和round 用gcc在工作站編譯出現如下訊息 /tmp/ccKNB6Ep.o: In function `DCT': a.c:(.text+0x2d7): undefined reference to `cos' a.c:(.text+0x329): undefined reference to `cos' a.c:(.text+0x3ad): undefined reference to `lround' collect2: ld returned 1 exit status 請問是怎麼回事? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.30.40

12/22 17:29, , 1F
gcc lala.c -lm
12/22 17:29, 1F

12/22 17:29, , 2F
不然他link不到
12/22 17:29, 2F

12/23 01:51, , 3F
用g++就好啦
12/23 01:51, 3F
文章代碼(AID): #13gc-LXY (b93902HW)