看板 LinuxDev 關於我們 聯絡資訊
#include <stdio.h> int main() { pritnf("hello world\n"); } root@04ed79da5285:~# gcc test.c /tmp/cc6HpDmJ.o: In function `main': test.c:(.text+0xf): undefined reference to `pritnf' collect2: ld returned 1 exit status 會出現 undefined reference to `pritnf' 我看 gcc -v 連接參數跟我正常可以編譯過得 差不多只是版本訊息不太一樣 gcc -v 我貼到下面網址裡面 https://gist.github.com/anonymous/cc9a2a3e05dc7d3cc5cf9e0fbf163617 在host端 printf函數是連接 /lib/x86_64-linux-gnu/libc.so.6 在docker gcc -v 裡面參數也有指定-L/usr/lib/x86_64-linux-gnu -lc 那悶為什麼會undefined reference to `pritnf' 謝謝 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 175.182.163.155 ※ 文章網址: https://www.ptt.cc/bbs/LinuxDev/M.1474009190.A.42B.html
dritchie: 不就打錯字嗎 09/16 15:25
gigigigi: XD..搞笑了...printfXD 09/16 15:37
lc85301: XDDDDD 09/16 22:13
lc85301: 原PO 眼睛業障重啊 09/16 22:14
final01: ..... 09/17 21:55
sivle: ............ 09/18 16:19
mayasky: .......害我認真想了 09/22 00:20
motea11: ..............認真+1 11/14 01:08