最近開始看Advanced Programming in the UNIX Environment一書 想要照著書上的程式碼試看看 所以去書上的網站下載了apue.h回來編譯 也把apue.h放入了/user/include 裡面 可是在編譯的時候會出現如下訊息 /tmp/cckYAUFP.o: In function `thr_fn': test_unix_programming.c:(.text+0xed): undefined reference to `pthread_sigmask' test_unix_programming.c:(.text+0x104): undefined reference to `err_sys' /tmp/cckYAUFP.o: In function `main': test_unix_programming.c:(.text+0x295): undefined reference to `err_quit' test_unix_programming.c:(.text+0x2d3): undefined reference to `err_quit' test_unix_programming.c:(.text+0x327): undefined reference to `err_sys' test_unix_programming.c:(.text+0x35f): undefined reference to `pthread_create' test_unix_programming.c:(.text+0x37b): undefined reference to `err_exit' test_unix_programming.c:(.text+0x3b3): undefined reference to `pthread_sigmask' test_unix_programming.c:(.text+0x3c3): undefined reference to `err_sys' collect2: ld 回傳 1 解決了好久都無法解決 想請問各位大大這該怎麼辦才好 謝謝大家 <(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.112.243.43 → freesamael:編譯器參數加上 -lpthread 試試 04/02 01:04