看板 Linux 關於我們 聯絡資訊
我寫了一個簡單的pthread problem 通常是要用 $>cc -lpthread pthread.c 來產生executable 那如果我想link時用ld的話 $>cc -c pthread.c $>ld --entry=main -lpthread pthread.o -o pthread 但其實這樣並不能執行 $>file pthread pthread: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), not stripped 通常正常的結果會是 : ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped 請問ld是還要加什麼東西呢??? thanks -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 203.67.242.96
jlovet:gcc -v xxx.c 可以看它執行的詳細動作 11/21 12:52