wwxbei 發(fā)表于 2012-07-02 16:39
寫了個(gè)C代碼,其中用到了pthread庫(kù)函數(shù), 于是用以下命令編譯:
gcc -lpthread test.c -o test
結(jié)果編譯 ...
MMMIX 發(fā)表于 2012-07-02 16:51
使用 Pthread 的話 gcc 最好用 -pthread 編譯,它不光會(huì)鏈接對(duì)應(yīng)的庫(kù),還會(huì)自行定義需要的宏。
歡迎光臨 Chinaunix (http://www.72891.cn/) | Powered by Discuz! X3.2 |